Updated NSIS script to support Driver and 32/64 bit installation
This commit is contained in:
		
							
								
								
									
										244
									
								
								windows/qcma.nsi
									
									
									
									
									
								
							
							
						
						
									
										244
									
								
								windows/qcma.nsi
									
									
									
									
									
								
							@@ -3,31 +3,32 @@
 | 
				
			|||||||
### Includes
 | 
					### Includes
 | 
				
			||||||
!include LogicLib.nsh
 | 
					!include LogicLib.nsh
 | 
				
			||||||
!include MUI.nsh
 | 
					!include MUI.nsh
 | 
				
			||||||
 | 
					!include x64.nsh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### General information
 | 
					### General information
 | 
				
			||||||
!define PRODUCT_NAME "qcma"
 | 
					!define PRODUCT_NAME "Qcma"
 | 
				
			||||||
!define PRODUCT_EXE_NAME "qcma.exe"
 | 
					!define PRODUCT_EXE_NAME "qcma.exe"
 | 
				
			||||||
!define PRODUCT_VERSION_MAJOR 0
 | 
					!define PRODUCT_VERSION_MAJOR 0
 | 
				
			||||||
!define PRODUCT_VERSION_MINOR 2
 | 
					!define PRODUCT_VERSION_MINOR 3
 | 
				
			||||||
!define PRODUCT_VERSION_BUILD 5
 | 
					!define PRODUCT_VERSION_BUILD 0
 | 
				
			||||||
!define PRODUCT_PUBLISHER "codestation"
 | 
					!define PRODUCT_PUBLISHER "codestation"
 | 
				
			||||||
!define PRODUCT_WEB_SITE "https://github.com/codestation/qcma"
 | 
					!define PRODUCT_WEB_SITE "https://github.com/codestation/qcma"
 | 
				
			||||||
!define PRODUCT_INSTALLSIZE 43811
 | 
					!define HELPURL "https://github.com/xiannox/qcma/wiki"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Macros
 | 
					### Macros
 | 
				
			||||||
!macro VerifyUserIsAdmin
 | 
					!macro VerifyUserIsAdmin
 | 
				
			||||||
UserInfo::GetAccountType
 | 
					UserInfo::GetAccountType
 | 
				
			||||||
pop $0
 | 
					pop $0
 | 
				
			||||||
${If} $0 != "admin" ;Require admin rights on NT4+
 | 
					${If} $0 != "admin" ;Require admin rights on NT4+
 | 
				
			||||||
	MessageBox mb_iconstop "Administrator rights required!"
 | 
					    MessageBox mb_iconstop "Administrator rights required!"
 | 
				
			||||||
	SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
 | 
					    SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
 | 
				
			||||||
	Quit
 | 
					    Quit
 | 
				
			||||||
${EndIf}
 | 
					${EndIf}
 | 
				
			||||||
!macroend
 | 
					!macroend
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Functions
 | 
					### Functions
 | 
				
			||||||
Function finishPageRunFunction
 | 
					Function finishPageRunFunction
 | 
				
			||||||
	ExecShell "" "$INSTDIR\${PRODUCT_EXE_NAME}"
 | 
					    ExecShell "" "$INSTDIR\${PRODUCT_EXE_NAME}"
 | 
				
			||||||
FunctionEnd
 | 
					FunctionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Variables
 | 
					### Variables
 | 
				
			||||||
@@ -43,7 +44,7 @@ RequestExecutionLevel admin
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# This will be in the installer/uninstaller title bar
 | 
					# This will be in the installer/uninstaller title bar
 | 
				
			||||||
Name "${PRODUCT_NAME}"
 | 
					Name "${PRODUCT_NAME}"
 | 
				
			||||||
OutFile "${PRODUCT_NAME}_setup.exe"
 | 
					OutFile "${PRODUCT_NAME}_setup_${PRODUCT_VERSION_MAJOR}.${PRODUCT_VERSION_MINOR}.${PRODUCT_VERSION_BUILD}.exe"
 | 
				
			||||||
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
 | 
					InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
!define MUI_LANGDLL_ALLLANGUAGES
 | 
					!define MUI_LANGDLL_ALLLANGUAGES
 | 
				
			||||||
@@ -77,100 +78,161 @@ InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
 | 
				
			|||||||
### Installer
 | 
					### Installer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function .onInit
 | 
					function .onInit
 | 
				
			||||||
	setShellVarContext all
 | 
					
 | 
				
			||||||
	!insertmacro VerifyUserIsAdmin
 | 
					    setShellVarContext all
 | 
				
			||||||
	!insertmacro MUI_LANGDLL_DISPLAY
 | 
					    !insertmacro VerifyUserIsAdmin
 | 
				
			||||||
 | 
					    !insertmacro MUI_LANGDLL_DISPLAY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ${If} ${RunningX64}
 | 
				
			||||||
 | 
					        StrCpy $InstDir "$ProgramFiles64\${PRODUCT_NAME}"
 | 
				
			||||||
 | 
					        SetRegView 64
 | 
				
			||||||
 | 
					    ${Else}
 | 
				
			||||||
 | 
					        StrCpy $InstDir "$ProgramFiles32\${PRODUCT_NAME}"
 | 
				
			||||||
 | 
					    ${EndIf}
 | 
				
			||||||
functionEnd
 | 
					functionEnd
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
section "install"
 | 
					section "install"
 | 
				
			||||||
	# Files for the install directory - to build the installer, these should be in the same directory as the install script (this file)
 | 
					    # Files for the install directory - to build the installer, these should be in the same directory as the install script (this file)
 | 
				
			||||||
	SetOutPath $INSTDIR
 | 
					    SetOutPath $InstDir
 | 
				
			||||||
	# Files added here should be removed by the uninstaller (see section "uninstall")
 | 
					 | 
				
			||||||
	File ${PRODUCT_EXE_NAME}
 | 
					 | 
				
			||||||
	File "qcma.ico"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	File "avcodec-55.dll"
 | 
					 | 
				
			||||||
	File "avformat-55.dll"
 | 
					 | 
				
			||||||
	File "avutil-52.dll"
 | 
					 | 
				
			||||||
	File "iconv.dll"
 | 
					 | 
				
			||||||
	File "libgcc_s_sjlj-1.dll"
 | 
					 | 
				
			||||||
	File "libjpeg-62.dll"
 | 
					 | 
				
			||||||
	File "libpcre16-0.dll"
 | 
					 | 
				
			||||||
	File "libpng16-16.dll"
 | 
					 | 
				
			||||||
	File "libstdc++-6.dll"
 | 
					 | 
				
			||||||
	File "libtiff-5.dll"
 | 
					 | 
				
			||||||
	File "libusb-1.0.dll"
 | 
					 | 
				
			||||||
	File "libvitamtp-2.dll"
 | 
					 | 
				
			||||||
	File "libwinpthread-1.dll"
 | 
					 | 
				
			||||||
	File "libxml2-2.dll"
 | 
					 | 
				
			||||||
	File "Qt5Core.dll"
 | 
					 | 
				
			||||||
	File "Qt5Gui.dll"
 | 
					 | 
				
			||||||
	File "Qt5Network.dll"
 | 
					 | 
				
			||||||
	File "Qt5Widgets.dll"
 | 
					 | 
				
			||||||
	File "swscale-2.dll"
 | 
					 | 
				
			||||||
	File "zlib1.dll"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	SetOutPath "$INSTDIR\platforms"
 | 
					 | 
				
			||||||
	File "platforms\qwindows.dll"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	SetOutPath "$INSTDIR\imageformats"
 | 
					 | 
				
			||||||
	File "imageformats\qgif.dll"
 | 
					 | 
				
			||||||
	File "imageformats\qjpeg.dll"
 | 
					 | 
				
			||||||
	File "imageformats\qtiff.dll"
 | 
					 | 
				
			||||||
 
 | 
					 | 
				
			||||||
	# Uninstaller - See function un.onInit and section "uninstall" for configuration
 | 
					 | 
				
			||||||
	WriteUninstaller "$INSTDIR\uninstall.exe"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	# Start Menu
 | 
					    # Files added here should be removed by the uninstaller (see section "uninstall")
 | 
				
			||||||
	!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
 | 
					    
 | 
				
			||||||
		CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
 | 
					    ${If} ${RunningX64}
 | 
				
			||||||
		CreateShortCut  "$SMPROGRAMS\$StartMenuFolder\${PRODUCT_NAME}.lnk" 				"$INSTDIR\${PRODUCT_EXE_NAME}"
 | 
					        File "win_x86_64\qcma.exe"
 | 
				
			||||||
		CreateShortCut  "$SMPROGRAMS\$StartMenuFolder\Uninstall ${PRODUCT_NAME}.lnk" 	"$INSTDIR\uninstall.exe"
 | 
					        File "win_x86_64\qcma_console.exe"
 | 
				
			||||||
	!insertmacro MUI_STARTMENU_WRITE_END
 | 
					        File "win_x86_64\avcodec-55.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\avformat-55.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\avutil-52.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\iconv.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\libgcc_s_seh-1.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\libiconv-2.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\libjpeg-62.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\libpcre16-0.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\libpng16-16.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\libsqlite3-0.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\libstdc++-6.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\libtiff-5.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\libusb-1.0.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\libvitamtp-3.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\libwinpthread-1.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\libxml2-2.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\Qt5Core.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\Qt5Gui.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\Qt5Network.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\Qt5Sql.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\Qt5Widgets.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\swscale-2.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\zlib1.dll"
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        SetOutPath "$INSTDIR\platforms"
 | 
				
			||||||
 | 
					        File "win_x86_64\platforms\qwindows.dll"
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        SetOutPath "$INSTDIR\imageformats"
 | 
				
			||||||
 | 
					        File "win_x86_64\imageformats\qgif.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\imageformats\qjpeg.dll"
 | 
				
			||||||
 | 
					        File "win_x86_64\imageformats\qtiff.dll"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        SetOutPath "$INSTDIR\sqldrivers"
 | 
				
			||||||
 | 
					        File "win_x86_64\sqldrivers\qsqlite.dll"
 | 
				
			||||||
 | 
					    ${Else}
 | 
				
			||||||
 | 
					        File "win_i686\qcma.exe"
 | 
				
			||||||
 | 
					        File "win_i686\qcma_console.exe"
 | 
				
			||||||
 | 
					        File "win_i686\avcodec-55.dll"
 | 
				
			||||||
 | 
					        File "win_i686\avformat-55.dll"
 | 
				
			||||||
 | 
					        File "win_i686\avutil-52.dll"
 | 
				
			||||||
 | 
					        File "win_i686\iconv.dll"
 | 
				
			||||||
 | 
					        File "win_i686\libgcc_s_sjlj-1.dll"
 | 
				
			||||||
 | 
					        File "win_i686\libiconv-2.dll"
 | 
				
			||||||
 | 
					        File "win_i686\libjpeg-62.dll"
 | 
				
			||||||
 | 
					        File "win_i686\libpcre16-0.dll"
 | 
				
			||||||
 | 
					        File "win_i686\libpng16-16.dll"
 | 
				
			||||||
 | 
					        File "win_i686\libsqlite3-0.dll"
 | 
				
			||||||
 | 
					        File "win_i686\libstdc++-6.dll"
 | 
				
			||||||
 | 
					        File "win_i686\libtiff-5.dll"
 | 
				
			||||||
 | 
					        File "win_i686\libusb-1.0.dll"
 | 
				
			||||||
 | 
					        File "win_i686\libvitamtp-3.dll"
 | 
				
			||||||
 | 
					        File "win_i686\libwinpthread-1.dll"
 | 
				
			||||||
 | 
					        File "win_i686\libxml2-2.dll"
 | 
				
			||||||
 | 
					        File "win_i686\Qt5Core.dll"
 | 
				
			||||||
 | 
					        File "win_i686\Qt5Gui.dll"
 | 
				
			||||||
 | 
					        File "win_i686\Qt5Sql.dll"
 | 
				
			||||||
 | 
					        File "win_i686\Qt5Network.dll"
 | 
				
			||||||
 | 
					        File "win_i686\Qt5Widgets.dll"
 | 
				
			||||||
 | 
					        File "win_i686\swscale-2.dll"
 | 
				
			||||||
 | 
					        File "win_i686\zlib1.dll"
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        SetOutPath "$INSTDIR\platforms"
 | 
				
			||||||
 | 
					        File "win_i686\platforms\qwindows.dll"
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        SetOutPath "$INSTDIR\imageformats"
 | 
				
			||||||
 | 
					        File "win_i686\imageformats\qgif.dll"
 | 
				
			||||||
 | 
					        File "win_i686\imageformats\qjpeg.dll"
 | 
				
			||||||
 | 
					        File "win_i686\imageformats\qtiff.dll"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        SetOutPath "$INSTDIR\sqldrivers"
 | 
				
			||||||
 | 
					        File "win_i686\sqldrivers\qsqlite.dll"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ${EndIf}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Uninstaller - See function un.onInit and section "uninstall" for configuration
 | 
				
			||||||
 | 
					    WriteUninstaller "$InstDir\uninstall.exe"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    SetOutPath $InstDir
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Start Menu
 | 
				
			||||||
 | 
					    !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
 | 
				
			||||||
 | 
					        CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
 | 
				
			||||||
 | 
					        CreateShortCut  "$SMPROGRAMS\$StartMenuFolder\${PRODUCT_NAME}.lnk"                 "$INSTDIR\${PRODUCT_EXE_NAME}"
 | 
				
			||||||
 | 
					        CreateShortCut  "$SMPROGRAMS\$StartMenuFolder\Uninstall ${PRODUCT_NAME}.lnk"     "$INSTDIR\uninstall.exe"
 | 
				
			||||||
 | 
					    !insertmacro MUI_STARTMENU_WRITE_END
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
	# Registry information for add/remove programs
 | 
					    # Registry information for add/remove programs
 | 
				
			||||||
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName" 		"${PRODUCT_NAME}"
 | 
					    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName"          "${PRODUCT_NAME}"
 | 
				
			||||||
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString" 	"$\"$INSTDIR\uninstall.exe$\""
 | 
					    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString"      "$\"$INSTDIR\uninstall.exe$\""
 | 
				
			||||||
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
 | 
					    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
 | 
				
			||||||
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "InstallLocation" 	"$\"$INSTDIR$\""
 | 
					    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "InstallLocation"      "$\"$INSTDIR$\""
 | 
				
			||||||
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayIcon" 		"$\"$INSTDIR\qcma.ico$\""
 | 
					    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayIcon"          "$\"$INSTDIR\qcma.ico$\""
 | 
				
			||||||
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "Publisher" 			"${PRODUCT_PUBLISHER}"
 | 
					    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "Publisher"            "${PRODUCT_PUBLISHER}"
 | 
				
			||||||
	#WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "HelpLink" 			"$\"${HELPURL}$\""
 | 
					    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "HelpLink"             "$\"${HELPURL}$\""
 | 
				
			||||||
	#WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "URLUpdateInfo" 	"$\"${UPDATEURL}$\""
 | 
					    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "URLInfoAbout"         "$\"${PRODUCT_WEB_SITE}$\""
 | 
				
			||||||
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "URLInfoAbout" 		"$\"${PRODUCT_WEB_SITE}$\""
 | 
					    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayVersion"       "${PRODUCT_VERSION_MAJOR}.${PRODUCT_VERSION_MINOR}.${PRODUCT_VERSION_BUILD}"
 | 
				
			||||||
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayVersion" 	"${PRODUCT_VERSION_MAJOR}.${PRODUCT_VERSION_MINOR}.${PRODUCT_VERSION_BUILD}"
 | 
					    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "VersionMajor"       ${PRODUCT_VERSION_MAJOR}
 | 
				
			||||||
	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "VersionMajor" 	${PRODUCT_VERSION_MAJOR}
 | 
					    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "VersionMinor"       ${PRODUCT_VERSION_MINOR}
 | 
				
			||||||
	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "VersionMinor" 	${PRODUCT_VERSION_MINOR}
 | 
					    # There is no option for modifying or repairing the install
 | 
				
			||||||
	# There is no option for modifying or repairing the install
 | 
					    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoModify" 1
 | 
				
			||||||
	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoModify" 1
 | 
					    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoRepair" 1
 | 
				
			||||||
	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoRepair" 1
 | 
					sectionEnd
 | 
				
			||||||
	# Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size
 | 
					
 | 
				
			||||||
	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "EstimatedSize" ${PRODUCT_INSTALLSIZE}
 | 
					section "driver"
 | 
				
			||||||
 | 
					    SetOutPath $InstDir\driver
 | 
				
			||||||
 | 
					    File "QcmaDriver.exe"
 | 
				
			||||||
 | 
					    DetailPrint "Starting the driver installation"     
 | 
				
			||||||
 | 
					    ExecWait "$InstDir\driver\QcmaDriver.exe"   
 | 
				
			||||||
sectionEnd
 | 
					sectionEnd
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
### Uninstaller
 | 
					### Uninstaller
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
function un.onInit
 | 
					function un.onInit
 | 
				
			||||||
	SetShellVarContext all
 | 
					    SetShellVarContext all
 | 
				
			||||||
	!insertmacro VerifyUserIsAdmin
 | 
					    !insertmacro VerifyUserIsAdmin
 | 
				
			||||||
	!insertmacro MUI_LANGDLL_DISPLAY
 | 
					    !insertmacro MUI_LANGDLL_DISPLAY
 | 
				
			||||||
functionEnd
 | 
					functionEnd
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
section "uninstall"
 | 
					section "uninstall"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Remove Start Menu launcher
 | 
				
			||||||
 | 
					    !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
 | 
				
			||||||
 | 
					    Delete "$SMPROGRAMS\$StartMenuFolder\${PRODUCT_NAME}.lnk"
 | 
				
			||||||
 | 
					    Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall ${PRODUCT_NAME}.lnk"
 | 
				
			||||||
 | 
					    RMDir "$SMPROGRAMS\$StartMenuFolder"
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    # Remove Desktop launcher
 | 
				
			||||||
 | 
					    Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
	# Remove Start Menu launcher
 | 
					    # Recursively remove the contents of $INSTDIR, then $INSTDIR itself
 | 
				
			||||||
	!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
 | 
					    RMDir /r "$INSTDIR"
 | 
				
			||||||
	Delete "$SMPROGRAMS\$StartMenuFolder\${PRODUCT_NAME}.lnk"
 | 
					    RMDir "$INSTDIR"
 | 
				
			||||||
	Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall ${PRODUCT_NAME}.lnk"
 | 
					 | 
				
			||||||
	RMDir "$SMPROGRAMS\$StartMenuFolder"
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	# Remove Desktop launcher
 | 
					 | 
				
			||||||
	Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
 | 
					 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
	# Recursively remove the contents of $INSTDIR, then $INSTDIR itself
 | 
					    # Remove uninstaller information from the registry
 | 
				
			||||||
	RMDir /r "$INSTDIR"
 | 
					    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
 | 
				
			||||||
	RMDir "$INSTDIR"
 | 
					sectionEnd
 | 
				
			||||||
 
 | 
					 | 
				
			||||||
	# Remove uninstaller information from the registry
 | 
					 | 
				
			||||||
	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
 | 
					 | 
				
			||||||
sectionEnd
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user