;--------------------- ;Include Modern UI !include "MUI.nsh" !include "LogicLib.nsh" !include "Image.nsh" ;-------------------------------- ;General ;Name and file Name "test" OutFile "test.exe" ;Default installation folder InstallDir "$PROGRAMFILES\test" ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\test" "" ;******Set MUI defaults !define MUI_ICON "E:\Projects\InstallScripts\test\Graphics\Icon\MyIcon.ico" !define MUI_UNICON "E:\Projects\InstallScripts\test\Graphics\Icon\MyIcon.ico" ; !define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit ;-------------------------------- ;Pages ;****** Install pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "E:\Projects\InstallScripts\test\License.txt" !insertmacro MUI_PAGE_COMPONENTS Page custom ChooseCamera !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH ;****** Uninstall pages ;*** show welcome page !insertmacro MUI_UNPAGE_WELCOME ; !insertmacro MUI_UNPAGE_CONFIRM ;*** Display's a page where the user ;*** can choose the directory to Unintall. ;*** Removed as it could be potentially ;*** dangerous. ;*** remove files !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH ;-------------------------------- ;Interface Settings !define MUI_ABORTWARNING ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Reserve Files ;If you are using solid compression, files that are required before ;the actual installation should be stored first in the data block, ;because this will make your installer start faster. ReserveFile "D:\Program Files\NSIS\Examples\Modern UI\ioB.ini" !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;-------------------------------- ;Variables Var INI_VALUE ;-------------------------------- ;-------------------------------- ;Installer Functions Function .onInit Var /GLOBAL bShowCameraSelection StrCpy $bShowCameraSelection "0" ;Extract InstallOptions INI files InitPluginsDir File /oname=$PLUGINSDIR\Image.bmp "e:\Projects\InstallScripts\test\Image.bmp" !insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioB.ini" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioB.ini" "Field 5" "Type" "Bitmap" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioB.ini" "Field 5" "Text" $PLUGINSDIR\Image.bmp ;*** tried with "$PLUGINSDIR\Image.bmp" no luck FunctionEnd ;---Installer Sections------- Section "test" Sectest SetOutPath "$INSTDIR" ;ADD YOUR OWN FILES HERE... File /r GroundFX\*.* ;Store installation folder WriteRegStr HKCU "Software\test" "" $INSTDIR ;******Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" ;****** Write Uninstall properties to registry and Add/Remove page WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\test" \ "DisplayName" "test" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\test" \ "UninstallString" "$INSTDIR\uninstall.exe" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\test" \ "DisplayIcon" "E:\Projects\InstallScripts\test\Graphics\Icon\MyIcon.ico" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\test" \ "Publisher" "MyCompany" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\test" \ "DisplayVersion" "1.4" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\test" \ "HelpLink" "www.MyCompany.com" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\test" \ "HelpTelephone" "1.416.340.3230" SectionEnd Function ChooseCamera ; WriteIniStr $PLUGINSDIR\ioB.ini "Field 5" Text $PLUGINSDIR\Image.bmp ${If} ${SectionIsSelected} ${Sectest} !insertmacro MUI_HEADER_TEXT "Choose Camera" "Choose which camera you want to install." !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioB.ini" ${EndIf} FunctionEnd ;-------------------------------- ;Descriptions ;Language strings LangString DESC_test ${LANG_ENGLISH} "A test section." ;Assign language strings to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${Sectest} $(DESC_Sectest) !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- ;---Uninstaller Section------- Section "Uninstall" ;ADD YOUR OWN FILES HERE... Delete "$INSTDIR\Uninstall.exe" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\test" RMDir /r "$INSTDIR" DeleteRegKey /ifempty HKCU "Software\test" SectionEnd