123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- ; example2.nsi
- ;
- ; This script is based on example1.nsi, but it remember the directory,
- ; has uninstall support and (optionally) installs start menu shortcuts.
- ;
- ; It will install example2.nsi into a directory that the user selects,
- ;--------------------------------
- ; Include Modern UI
- !include "MUI2.nsh"
- ;--------------------------------
- ; The name of the installer
- Name "Hybrid Application Generator"
- ; Installer branding
- ; BrandingText "Nokia Hybrid Application Generator"
- ; Better compression
- SetCompressor /SOLID lzma
- SetOverwrite ifnewer
- CRCCheck on
- ; The file to write
- OutFile "Nokia HAG Installer.exe"
- ; The default installation directory
- InstallDir "$PROGRAMFILES\Nokia\Hybrid Application Generator"
- ; Registry key to check for directory (so if you install again, it will
- ; overwrite the old one automatically)
- InstallDirRegKey HKLM "Software\Nokia\Hybrid Application Generator\Installer" "Install_Dir"
- ; Request application privileges for Windows Vista
- RequestExecutionLevel user
- ;--------------------------------
- ; Interface Settings
- !define MUI_ABORTWARNING
- ;--------------------------------
- ; Pages
- !insertmacro MUI_PAGE_LICENSE "release_current\License.txt"
- !insertmacro MUI_PAGE_COMPONENTS
- !insertmacro MUI_PAGE_DIRECTORY
- !insertmacro MUI_PAGE_INSTFILES
- # These indented statements modify settings for MUI_PAGE_FINISH
- !define MUI_FINISHPAGE_NOAUTOCLOSE
- !define MUI_FINISHPAGE_RUN
- !define MUI_FINISHPAGE_RUN_NOTCHECKED
- !define MUI_FINISHPAGE_RUN_TEXT "Run Hybrid Application Generator"
- !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchApplication"
- ; !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
- !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\Readme.txt
- !insertmacro MUI_PAGE_FINISH
- !insertmacro MUI_UNPAGE_CONFIRM
- !insertmacro MUI_UNPAGE_COMPONENTS
- !insertmacro MUI_UNPAGE_INSTFILES
- !insertmacro MUI_UNPAGE_FINISH
- ;--------------------------------
- ;Languages
- !insertmacro MUI_LANGUAGE "English"
- ;--------------------------------
- ; The stuff to install
- Section "Core Application" Core
- SectionIn RO
-
- ; Set output path to the installation directory.
- SetOutPath $INSTDIR
-
- ; Put the files
- File /r /x examples release_current\*.*
-
- ; Write the installation path into the registry
- WriteRegStr HKLM "Software\Nokia\Hybrid Application Generator" "Install_Dir" "$INSTDIR"
-
- ; Write the uninstall keys for Windows
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid Application Generator" "DisplayName" "Nokia Hybrid Application Generator"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid Application Generator" "UninstallString" '"$INSTDIR\uninstall.exe"'
- WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid Application Generator" "NoModify" 1
- WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid Application Generator" "NoRepair" 1
- WriteUninstaller "uninstall.exe"
-
- SectionEnd
- ; Examples -- optional
- Section "Demo Applications" Demos
- SetOutPath $INSTDIR\examples
- File /r release_current\examples\*.*
- SetOutPath $INSTDIR
- SectionEnd
- ; Optional section (can be disabled by the user)
- Section "Start Menu Shortcuts" Shortcuts
- CreateDirectory "$SMPROGRAMS\Nokia Hybrid Application Generator"
- CreateShortCut "$SMPROGRAMS\Nokia Hybrid Application Generator\Hybrid Application Generator.lnk" "$INSTDIR\HAG.exe" "" "$INSTDIR\HAG.exe" 0
- CreateShortCut "$SMPROGRAMS\Nokia Hybrid Application Generator\Documentation.lnk" "$INSTDIR\HAG User Guide.pdf" "" "$INSTDIR\HAG User Guide.pdf" 0
- CreateShortCut "$SMPROGRAMS\Nokia Hybrid Application Generator\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
-
- SectionEnd
- ;--------------------------------
- ; Section descriptions
- LangString DESC_Core ${LANG_ENGLISH} "Installs Hybrid Application Generator main executable, framework files, and the default set of HAG plugins."
- LangString DESC_Demos ${LANG_ENGLISH} "Installs demo applications. The demo applications are introduced in the HAG User Guide."
- LangString DESC_Shortcuts ${LANG_ENGLISH} "Installs start menu shortcuts for easier access to application."
- !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
- !insertmacro MUI_DESCRIPTION_TEXT ${Core} $(DESC_Core)
- !insertmacro MUI_DESCRIPTION_TEXT ${Demos} $(DESC_Demos)
- !insertmacro MUI_DESCRIPTION_TEXT ${Shortcuts} $(DESC_Shortcuts)
- !insertmacro MUI_FUNCTION_DESCRIPTION_END
- ;--------------------------------
- ; Uninstaller
- Section "un.Core Application" un.Core
-
- SectionIn RO
- ; Remove registry keys
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid Application Generator"
- DeleteRegKey HKLM "Software\Nokia\Hybrid Application Generator"
- ; Remove the application. Do not use simple recursive $INSTDIR removal, since that will actually cause
- ; the removal of the current directory of uninstall.exe, potentially wiping out everything.
- RMDir /r "$INSTDIR\examples"
- RMDir /r "$INSTDIR\fw"
- RMDir /r "$INSTDIR\iconengines"
- RMDir /r "$INSTDIR\oxygen-icons"
- RMDir /r "$INSTDIR\imageformats"
- RMDir /r "$INSTDIR\mw"
- RMDir /r "$INSTDIR\templates"
- ; HAG executables, guide, and default log file
- Delete /REBOOTOK "$INSTDIR\HAG User Guide.pdf"
- Delete /REBOOTOK "$INSTDIR\HAG.exe"
- Delete /REBOOTOK "$INSTDIR\launcher.exe"
- Delete /REBOOTOK "$INSTDIR\unzip.exe"
- Delete /REBOOTOK "$INSTDIR\wget.exe"
- Delete /REBOOTOK "$INSTDIR\uninstall.exe"
- Delete /REBOOTOK "$INSTDIR\hag.log"
- ; HAG runtimes
- Delete /REBOOTOK "$INSTDIR\msvcr90.dll"
- Delete /REBOOTOK "$INSTDIR\Qt*.dll"
- Delete /REBOOTOK "$INSTDIR\phonon4.dll"
- Delete /REBOOTOK "$INSTDIR\hybridfw.dll"
- Delete /REBOOTOK "$INSTDIR\locationapi.dll"
- ; wget runtimes
- Delete /REBOOTOK "$INSTDIR\libeay32.dll"
- Delete /REBOOTOK "$INSTDIR\libiconv2.dll"
- Delete /REBOOTOK "$INSTDIR\libintl3.dll"
- Delete /REBOOTOK "$INSTDIR\libssl32.dll"
- ; Licenses, readme
- Delete /REBOOTOK "$INSTDIR\License.txt";
- Delete /REBOOTOK "$INSTDIR\Readme.txt"
- ; Now, this will only work if the directory is empty
- RMDir "$INSTDIR"
- ; Remove shortcuts, if any
- Delete "$SMPROGRAMS\Nokia Hybrid Application Generator\*.*"
- ; Remove directories used
- RMDir "$SMPROGRAMS\Nokia Hybrid Application Generator"
- RMDir "$INSTDIR"
- SectionEnd
- Section /o "un.Preferences" un.Preferences
- ; Remove permanent settings from the current user
- DeleteRegKey HKCU "Software\Nokia\Hybrid Application Generator"
- SectionEnd
- ;--------------------------------
- ; Section descriptions
- LangString DESC_un.Core ${LANG_ENGLISH} "Removes Hybrid Application Generator main executable, framework files, plugins, demo applications, and start menu shortcuts."
- LangString DESC_un.Preferences ${LANG_ENGLISH} "Removes Hybrid Application Generator permanent settings."
- !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
- !insertmacro MUI_DESCRIPTION_TEXT ${un.Core} $(DESC_un.Core)
- !insertmacro MUI_DESCRIPTION_TEXT ${un.Preferences} $(DESC_un.Preferences)
- !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
- ;--------------------------------
- ; Launch application?
- Function LaunchApplication
- ExecShell "" "$INSTDIR\HAG.exe"
- FunctionEnd
|