Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
;Found at http://community.omnicom.no/blogs/lea/archive/2008/10/17/prism-and-nsis-to-the-rescue.aspx
;NSIS Modern User Interface
;--------------------------------
; Start
!include "MUI2.nsh"
!define MUI_PRODUCT "Name of webapp"
!define MUI_VERSION ""
!define MUI_BRANDINGTEXT "Your company here"
CRCCheck On
;!include "${NSISDIR}\Contrib\Modern UI\System.nsh"
;--------------------------------
;General
;Name and file
Name "Name of webapp"
OutFile "setup.exe"
;Default installation folder
InstallDir "$PROGRAMFILES\Prism"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\Prism" ""
;Request application privileges for Windows Vista
RequestExecutionLevel user
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
!define MUI_ICON "---PATH TO SETUP ICON HERE---"; There's some in the NSIS folder
!define MUI_UNICON "---PATH TO SETUP ICON HERE---"
!define MUI_WELCOMEPAGE
!define MUI_UNINSTALLER
!define MUI_UNCONFIRMPAGE
!define MUI_FINISHPAGE
;Pages
!insertmacro MUI_PAGE_WELCOME
!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_CHECKED
!define MUI_FINISHPAGE_RUN_TEXT "Start -- YOUR APP NAME HERE --"
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
!insertmacro MUI_PAGE_FINISH
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;--------------------------------
;Installer Sections
Section "Install Section" SecInstall
; set the context for $SMPROGRAMS and other shell folder to the 'current' user
SetShellVarContext current
; PRISM webApp data is recursively copied from yourAppAppData to "$APPDATA\WebApps"
SetOutPath "$APPDATA\WebApps\-- YOUR PRISM APP NAME HERE --@prism.app\"
File /r --- YOUR APPDATA FOLDER HERE --- \WebApps\-- YOUR PRISM APP NAME HERE --@prism.app\*
; PRISM application data is recursively copied from yourAppPgmFiles to "$APPDATA\yourApp\Prism"
SetOutPath "$PROGRAMFILES\Prism"
File /r C:\Program Files\Prism\*
;windirExists:
;Store installation folder
WriteRegStr HKCU "Software\Prism" "" $INSTDIR
;Create Shortcut links
CreateShortcut "$DESKTOP\${MUI_PRODUCT}.lnk" "$PROGRAMFILES\Prism\prism.exe" "-override $\"$APPDATA\WebApps\-- YOUR PRISM APP NAME --@prism.app\override.ini$\" -webapp -- YOUR PRISM APP NAME --@prism.app" "$APPDATA\WebApps\-- YOUR PRISM APP NAME --@prism.app\icons\default\webapp.ico"
;Create uninstaller
;write uninstall information to the registry
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT} (remove only)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" "$INSTDIR\Uninstall.exe"
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
; set the context for $SMPROGRAMS and other shell folder to the 'current' user
SetShellVarContext current
;ADD YOUR OWN FILES HERE...
Delete "$DESKTOP\${MUI_PRODUCT}.lnk"
Delete "$INSTDIR\Uninstall.exe"
;Delete Files
RMDir /r "$INSTDIR\*.*"
RMDir "$INSTDIR"
RMDir "$PROGRAMFILES\Prism"
RmDir "$APPDATA\WebApps\-- YOUR PRISM APP NAME --@prism.app"
;Delete Uninstaller And Unistall Registry Entries
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${MUI_PRODUCT}"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}"
DeleteRegKey /ifempty HKCU "Software\Prism"
SectionEnd
Function LaunchLink
SetShellVarContext current
ExecShell "" "$DESKTOP\${MUI_PRODUCT}.lnk"
FunctionEnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.