File Annotation
Not logged in
76bd88c262 2008-03-12  mjanssen: ; example2.nsi
76bd88c262 2008-03-12  mjanssen: ;
76bd88c262 2008-03-12  mjanssen: ; This script is based on example1.nsi, but adds uninstall support
76bd88c262 2008-03-12  mjanssen: ; and (optionally) start menu shortcuts.
76bd88c262 2008-03-12  mjanssen: ;
76bd88c262 2008-03-12  mjanssen: ; It will install notepad.exe into a directory that the user selects,
76bd88c262 2008-03-12  mjanssen: ;
76bd88c262 2008-03-12  mjanssen: 
76bd88c262 2008-03-12  mjanssen: ; The name of the installer
76bd88c262 2008-03-12  mjanssen: Name "Fossil"
76bd88c262 2008-03-12  mjanssen: 
76bd88c262 2008-03-12  mjanssen: ; The file to write
76bd88c262 2008-03-12  mjanssen: OutFile "fossil-setup-7c0bd3ee08.exe"
76bd88c262 2008-03-12  mjanssen: 
76bd88c262 2008-03-12  mjanssen: ; The default installation directory
76bd88c262 2008-03-12  mjanssen: InstallDir $PROGRAMFILES\Fossil
76bd88c262 2008-03-12  mjanssen: ; Registry key to check for directory (so if you install again, it will
76bd88c262 2008-03-12  mjanssen: ; overwrite the old one automatically)
76bd88c262 2008-03-12  mjanssen: InstallDirRegKey HKLM SOFTWARE\Fossil "Install_Dir"
76bd88c262 2008-03-12  mjanssen: 
76bd88c262 2008-03-12  mjanssen: ; The text to prompt the user to enter a directory
76bd88c262 2008-03-12  mjanssen: ComponentText "This will install fossil on your computer."
76bd88c262 2008-03-12  mjanssen: ; The text to prompt the user to enter a directory
76bd88c262 2008-03-12  mjanssen: DirText "Choose a directory to install in to:"
76bd88c262 2008-03-12  mjanssen: 
76bd88c262 2008-03-12  mjanssen: ; The stuff to install
76bd88c262 2008-03-12  mjanssen: Section "Fossil (required)"
76bd88c262 2008-03-12  mjanssen:   ; Set output path to the installation directory.
76bd88c262 2008-03-12  mjanssen:   SetOutPath $INSTDIR
76bd88c262 2008-03-12  mjanssen:   ; Put file there
76bd88c262 2008-03-12  mjanssen:   File ".\build\fossil.exe"
76bd88c262 2008-03-12  mjanssen:   ; Write the installation path into the registry
76bd88c262 2008-03-12  mjanssen:   WriteRegStr HKLM SOFTWARE\Fossil "Install_Dir" "$INSTDIR"
76bd88c262 2008-03-12  mjanssen:   ; Write the uninstall keys for Windows
76bd88c262 2008-03-12  mjanssen:   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil" "DisplayName" "Fossil (remove only)"
76bd88c262 2008-03-12  mjanssen:   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil" "UninstallString" '"$INSTDIR\uninstall.exe"'
76bd88c262 2008-03-12  mjanssen:   WriteUninstaller "uninstall.exe"
76bd88c262 2008-03-12  mjanssen: SectionEnd
76bd88c262 2008-03-12  mjanssen: 
76bd88c262 2008-03-12  mjanssen: 
76bd88c262 2008-03-12  mjanssen: ; uninstall stuff
76bd88c262 2008-03-12  mjanssen: 
76bd88c262 2008-03-12  mjanssen: UninstallText "This will uninstall fossil. Hit next to continue."
76bd88c262 2008-03-12  mjanssen: 
76bd88c262 2008-03-12  mjanssen: ; special uninstall section.
76bd88c262 2008-03-12  mjanssen: Section "Uninstall"
76bd88c262 2008-03-12  mjanssen:   ; remove registry keys
76bd88c262 2008-03-12  mjanssen:   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil"
76bd88c262 2008-03-12  mjanssen:   DeleteRegKey HKLM SOFTWARE\Fossil
76bd88c262 2008-03-12  mjanssen:   ; remove files
76bd88c262 2008-03-12  mjanssen:   Delete $INSTDIR\fossil.exe
76bd88c262 2008-03-12  mjanssen:   ; MUST REMOVE UNINSTALLER, too
76bd88c262 2008-03-12  mjanssen:   Delete $INSTDIR\uninstall.exe
76bd88c262 2008-03-12  mjanssen:   ; remove shortcuts, if any.
76bd88c262 2008-03-12  mjanssen:   RMDir "$SMPROGRAMS\Fossil"
76bd88c262 2008-03-12  mjanssen:   RMDir "$INSTDIR"
76bd88c262 2008-03-12  mjanssen: SectionEnd
76bd88c262 2008-03-12  mjanssen: 
76bd88c262 2008-03-12  mjanssen: ; eof