From f3b8ae501a421beda9da03f59dca74c6a145e8b9 Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Tue, 16 Feb 2021 18:21:01 +0100 Subject: [PATCH 1/3] Fix typo in installer --- windows/installer.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/installer.nsi b/windows/installer.nsi index f5f50d3694..a98990d797 100755 --- a/windows/installer.nsi +++ b/windows/installer.nsi @@ -30,7 +30,7 @@ RequestExecutionLevel admin ; Administrator privileges are required for install Name "${APP_NAME}" OutFile "${DEPLOY_PATH}\${APP_NAME}-${APP_VERSION}-installer-win.exe" Caption "${APP_NAME} ${APP_VERSION} Installer" -BrandingText "${APP_NAME} Make music online. With friends. For free." +BrandingText "${APP_NAME}. Make music online. With friends. For free." ; Additional plugin location (for nsProcess) !addplugindir "${WINDOWS_PATH}" From 781bd8fd997b2ec16a94ddc4c11735f1e1e2a6b4 Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Tue, 16 Feb 2021 18:23:21 +0100 Subject: [PATCH 2/3] Drop admin privs on installer with workaround --- windows/installer.nsi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/windows/installer.nsi b/windows/installer.nsi index a98990d797..8fc9e96565 100755 --- a/windows/installer.nsi +++ b/windows/installer.nsi @@ -60,7 +60,8 @@ Page Custom ASIOCheckInstalled ExitASIOInstalled !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishPage.Show -!define MUI_FINISHPAGE_RUN "$INSTDIR\${APP_EXE}" +!define MUI_FINISHPAGE_RUN +!define MUI_FINISHPAGE_RUN_FUNCTION FinishPage.Run !define MUI_FINISHPAGE_SHOWREADME "" !define MUI_FINISHPAGE_SHOWREADME_CHECKED !define MUI_FINISHPAGE_SHOWREADME_TEXT "$(DESKTOP_SET_SHORTCUT)" @@ -303,6 +304,10 @@ Function FinishPage.Show ; set the user choices if they were remembered FunctionEnd +Function FinishPage.Run ; run the app + Exec '"$WINDIR\explorer.exe" "$INSTDIR\${APP_EXE}"' ; see http://mdb-blog.blogspot.com/2013/01/nsis-lunch-program-as-user-from-uac.html and http://nsis.sourceforge.net/Run_an_application_shortcut_after_an_install +FunctionEnd + Function AbortOnRunningApp !insertmacro _AbortOnRunningApp FunctionEnd From 0cd07b9b2b7fd57a077312d57d92601012d8a4f8 Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Tue, 16 Feb 2021 18:23:56 +0100 Subject: [PATCH 3/3] Remember if user checked run app --- windows/installer.nsi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/windows/installer.nsi b/windows/installer.nsi index 8fc9e96565..695262468a 100755 --- a/windows/installer.nsi +++ b/windows/installer.nsi @@ -13,6 +13,7 @@ !define APP_INSTALL_KEY "Software\${APP_NAME}" !define APP_INSTALL_VALUE "InstallFolder" !define APP_INSTALL_ICON "InstallDtIcon" +!define APP_RUN "RunAppAfterInstall" !define AUTORUN_NAME "${APP_NAME} Server" !define AUTORUN_KEY "Software\Microsoft\Windows\CurrentVersion\Run" !define APP_EXE "${APP_NAME}.exe" @@ -103,6 +104,7 @@ Var Button ; Define user choices Var bInstallDtIcon +Var bRunApp ; Installer @@ -270,6 +272,10 @@ Function .onInit SetShellVarContext all ; get user choices (open program, dt icon,...) + ReadRegStr $bRunApp HKLM "${APP_INSTALL_KEY}" "${APP_RUN}" + IfErrors 0 +2 + StrCpy $bRunApp "1" + ReadRegStr $bInstallDtIcon HKLM "${APP_INSTALL_KEY}" "${APP_INSTALL_ICON}" IfErrors 0 +2 StrCpy $bInstallDtIcon "1" @@ -302,9 +308,19 @@ Function FinishPage.Show ; set the user choices if they were remembered ShowWindow $mui.FinishPage.Showreadme 1 + WriteRegStr HKLM "${APP_INSTALL_KEY}" "${APP_RUN}" "0" ; this will be overwritten if the box is checked + ${If} $bRunApp == 1 ; Check the run checkbox + SendMessage $mui.FinishPage.Run ${BM_SETCHECK} ${BST_CHECKED} 0 + ${Else} + SendMessage $mui.FinishPage.Run ${BM_SETCHECK} ${BST_UNCHECKED} 0 + ${EndIf} + + ShowWindow $mui.FinishPage.Run 1 + FunctionEnd Function FinishPage.Run ; run the app + WriteRegStr HKLM "${APP_INSTALL_KEY}" "${APP_RUN}" "1" ; remember that app should run next time Exec '"$WINDIR\explorer.exe" "$INSTDIR\${APP_EXE}"' ; see http://mdb-blog.blogspot.com/2013/01/nsis-lunch-program-as-user-from-uac.html and http://nsis.sourceforge.net/Run_an_application_shortcut_after_an_install FunctionEnd