diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-02-01 10:34:01 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-02-01 10:34:01 -0800 |
commit | 1e03962e8fb05df0991b79014187cf1bf0af4396 (patch) | |
tree | c3a707b9402fd72ee71ce1b8a7a05508e7df3977 /inst.nsi | |
parent | 5431f3f9ab2f41df5f702f31b19a27e5061fd730 (diff) | |
download | txr-1e03962e8fb05df0991b79014187cf1bf0af4396.tar.gz txr-1e03962e8fb05df0991b79014187cf1bf0af4396.tar.bz2 txr-1e03962e8fb05df0991b79014187cf1bf0af4396.zip |
Windows installer.
* inst.nsi: New file.
* win/env.nsh: New file.
Diffstat (limited to 'inst.nsi')
-rw-r--r-- | inst.nsi | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/inst.nsi b/inst.nsi new file mode 100644 index 00000000..e774d910 --- /dev/null +++ b/inst.nsi @@ -0,0 +1,84 @@ +!include win\env.nsh + +# name the installer +outFile "txr-installer.exe" +Name "TXR" + +Icon "win\txr.ico" +UninstallIcon "win\txr.ico" + +SetCompressor lzma +CRCCheck on +RequestExecutionLevel admin + +Function .onInit + # default installation dir + StrCpy $INSTDIR "C:\Program Files" +FunctionEnd + +Function .onInstSuccess + MessageBox MB_YESNO "Expore the TXR installation directory now?" IDNO NoLaunch + Exec '"$WINDIR\explorer.exe" "$INSTDIR\txr"' + NoLaunch: +FunctionEnd + +PageEx license + LicenseText "Use and redistribution of TXR requires agreement with terms of the license." "Agree" + LicenseData LICENSE + Caption ": Licensing" +PageExEnd + +PageEx directory + DirVar $INSTDIR +PageExEnd + +Page instfiles +UninstPage uninstConfirm +UninstPage instfiles + +section "TXR" + SetShellVarContext current + SetOutPath $INSTDIR\txr\bin + File txr.exe + SetOutPath $INSTDIR\txr\doc + File txr-manpage.html + File txr-manpage.pdf + SetOutPath $INSTDIR\txr\share\man\man1 + File txr.1 + SetOutPath $INSTDIR\txr\share\txr + File LICENSE + File METALICENSE + SetOutPath $INSTDIR\txr\share\txr\stdlib + File share\txr\stdlib\*.txr + WriteUninstaller $INSTDIR\txr\uninstall.exe + CreateDirectory "$SMPROGRAMS\TXR" + CreateShortCut "$SMPROGRAMS\TXR\txr.lnk" "$INSTDIR\txr" + CreateShortCut "$SMPROGRAMS\TXR\uninstall.lnk" "$INSTDIR\TXR\uninstall.exe" + CreateShortCut "$STARTMENU\txr.lnk" "$INSTDIR\TXR" + ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\TXR\bin" +sectionEnd + +section "Uninstall" + SetShellVarContext current + # $INSTDIR is now where the uninstaller is installed, + # not the $INSTDIR that was used during installation! + + ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\bin" + RMDir /r "$INSTDIR" + Delete "$SMPROGRAMS\TXR\txr.lnk" + Delete "$STARTMENU\txr.lnk" + IfErrors errors removeInstaller +errors: + MessageBox MB_OK|MB_ICONEXCLAMATION "Some files or folders in were not deleted. Make sure the program is stopped and run the uninstaller again." IDOK quit +removeInstaller: + Delete "$INSTDIR\uninstall.exe" + RMDir /r "$INSTDIR" + Delete "$SMPROGRAMS\txr\uninstall.lnk" + RmDir /r "$SMPROGRAMS\txr" + IfErrors fatal done +fatal: + MessageBox MB_OK|MB_ICONEXCLAMATION "The uninstaller itself was not completely deleted for some reason. It looks like you have to manually remove $SMPROGRAMS\txr and $INSTDIR." IDOK quit +quit: + Quit +done: +sectionEnd |