;-------------------------------- ; Defines !define APPLICATION "SecureW2 Installer example" !define VERSION "1.0.0" ;-------------------------------- ;Include Modern UI !include "MUI.nsh" ;-------------------------------- ;General ;Name and file Name "${APPLICATION} ${VERSION}" OutFile "SecureW2_example.exe" ;-------------------------------- ;Interface Settings !define MUI_ICON "..\..\SecureW2.ico" !define MUI_UNICON "..\..\SecureW2.ico" ;-------------------------------- ;Pages !define MUI_ABORTWARNING !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Installer Sections Section "${APPLICATION}" SecInstall SectionIn RO ; ; Extract all file to the temp dir ; SetOutPath $TEMPDIR ; ; Define all the files required for the installation here: ; SecureW2_xxx.exe, ; SecureW2.inf and ; all the certificates ; Note: The locations are relative to the .nsi file ; File "SecureW2_Enterprise_Client_313.exe" File "SecureW2.inf" File "sw2.cer" ; Use the /S command for a silent install ExecWait "SecureW2_Enterprise_Client_313.exe /S" ; ; If an error occurs then goto Error label else goto Continue label ; IfErrors Error Goto Continue ; ; Error Label, show error box and then quit ; Error: MessageBox MB_OK|MB_ICONEXCLAMATION "Error while installing SecureW2. Please try again, otherwise contact your System Adminstrator" Goto Quit ; ; Continue Label ; Continue: ; we need to reboot the system for the changes to take effect SetRebootFlag true ; ; Remove temporary files ; Delete "$TEMPDIR\SecureW2_Enterprise_Client_313.exe" Delete "$TEMPDIR\SecureW2.inf" Delete "$TEMPDIR\sw2.cer" Quit: SectionEnd