-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nsis): per-machine installer automatically removes old version #621
- Loading branch information
Showing
13 changed files
with
150 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
${IfNot} ${Silent} | ||
SetDetailsPrint none | ||
|
||
!ifdef ONE_CLICK | ||
!ifdef HEADER_ICO | ||
SpiderBanner::Show /MODERN /ICON "$PLUGINSDIR\installerHeaderico.ico" | ||
!else | ||
SpiderBanner::Show /MODERN | ||
!endif | ||
!endif | ||
${endif} | ||
|
||
!insertmacro CHECK_APP_RUNNING "install" | ||
|
||
${if} $installMode == "all" | ||
ReadRegStr $R0 HKEY_LOCAL_MACHINE "${UNINSTALL_REGISTRY_KEY}" UninstallString | ||
${if} $R0 != "" | ||
ExecWait "$R0 /S" | ||
${endif} | ||
${endif} | ||
|
||
RMDir /r $INSTDIR | ||
SetOutPath $INSTDIR | ||
|
||
!ifdef APP_64 | ||
${If} ${RunningX64} | ||
Nsis7z::Extract "$PLUGINSDIR\app-64.7z" | ||
${Else} | ||
Nsis7z::Extract "$PLUGINSDIR\app-32.7z" | ||
${endif} | ||
!else | ||
Nsis7z::Extract "$PLUGINSDIR\app-32.7z" | ||
!endif | ||
|
||
File "/oname=${UNINSTALL_FILENAME}" "${UNINSTALLER_OUT_FILE}" | ||
|
||
!insertmacro registryAddInstallInfo | ||
|
||
StrCpy $startMenuLink "$SMPROGRAMS\${PRODUCT_FILENAME}.lnk" | ||
StrCpy $desktopLink "$DESKTOP\${PRODUCT_FILENAME}.lnk" | ||
|
||
# create shortcuts in the start menu and on the desktop | ||
# shortcut for uninstall is bad cause user can choose this by mistake during search, so, we don't add it | ||
CreateShortCut "$startMenuLink" "$INSTDIR\${APP_EXECUTABLE_FILENAME}" "" "$INSTDIR\${APP_EXECUTABLE_FILENAME}" 0 "" "" "${APP_DESCRIPTION}" | ||
CreateShortCut "$desktopLink" "$INSTDIR\${APP_EXECUTABLE_FILENAME}" "" "$INSTDIR\${APP_EXECUTABLE_FILENAME}" 0 "" "" "${APP_DESCRIPTION}" | ||
|
||
WinShell::SetLnkAUMI "$startMenuLink" "${APP_ID}" | ||
WinShell::SetLnkAUMI "$desktopLink" "${APP_ID}" | ||
|
||
!ifmacrodef registerFileAssociations | ||
!insertmacro registerFileAssociations | ||
!endif | ||
|
||
!ifmacrodef customInstall | ||
!insertmacro customInstall | ||
!endif | ||
|
||
${IfNot} ${Silent} | ||
!ifdef ONE_CLICK | ||
# otherwise app window will be in backround | ||
HideWindow | ||
!ifdef RUN_AFTER_FINISH | ||
Call StartApp | ||
!endif | ||
!endif | ||
${EndIf} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.