-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathNullsoftInstallerScript.nsi
149 lines (127 loc) · 6.08 KB
/
NullsoftInstallerScript.nsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Multiple Hash 2012"
!define PRODUCT_VERSION "V1.6.1.2"
!define PRODUCT_PUBLISHER "Keith Martin"
!define PRODUCT_WEB_SITE "https://github.com/keif888/SSISMHash/"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "..\MultipleHash2008\License.txt"
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "SetupMultipleHash2012_${PRODUCT_VERSION}.exe"
InstallDir "$PROGRAMFILES\Multiple Hash 2012"
ShowInstDetails show
ShowUnInstDetails show
; Request application privileges for Windows Vista
RequestExecutionLevel admin
Section "MainSection" SEC01
DetailPrint 'Do 32 Bit Install.'
SetRegView 32
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Microsoft SQL Server\110\SSIS\Setup\DTSPath" ""
IfFileExists "$0PipelineComponents\MultipleHash2012.dll" 0 +6
DetailPrint 'Unregister existing MultipleHash2012.dll'
SetOutPath '$TEMP'
SetOverwrite on
File 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\GacUtil.exe'
File 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe.config'
File 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\1033\gacutlrc.dll'
nsExec::ExecToLog '"$TEMP\gacutil.exe" /u MultipleHash2012'
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Microsoft SQL Server\110\SSIS\Setup\DTSPath" ""
SetOutPath "$0PipelineComponents"
SetOverwrite on
DetailPrint '..Installing MultipleHash2012.dll to $0PipelineComponents'
File "bin\Release\MultipleHash2012.dll"
SetOutPath "$0UpgradeMappings"
SetOverwrite on
File ".\SSISMHash.xml"
SetRegView 64
ReadRegStr $1 HKLM "SOFTWARE\Microsoft\Microsoft SQL Server\110\SSIS\Setup\DTSPath" ""
StrCmp $0 $1 +9 0
DetailPrint 'Do 64 Bit Install.'
SetOutPath "$1PipelineComponents"
SetOverwrite on
DetailPrint '..Installing MultipleHash2012.dll to $1PipelineComponents'
File "bin\Release\MultipleHash2012.dll"
SetOutPath "$1UpgradeMappings"
SetOverwrite on
File ".\SSISMHash.xml"
SetRegView 32
DetailPrint 'Finished installing MultipleHash2012.dll onto Computer.'
DetailPrint 'Install MultipleHash2012.dll to Assembly Cache'
SetOutPath '$TEMP'
SetOverwrite on
File 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\GacUtil.exe'
File 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe.config'
File 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\1033\gacutlrc.dll'
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Microsoft SQL Server\110\SSIS\Setup\DTSPath" ""
nsExec::ExecToLog '"$TEMP\gacutil.exe" /i "$0\PipelineComponents\MultipleHash2012.dll"'
DetailPrint 'Please check the output from the Assembly Registration above for Errors.'
Delete "$TEMP\gacutil.exe"
Delete "$TEMP\gacutil.exe.config"
Delete "$TEMP\gacutlrc.dll"
SetOutPath '$INSTDIR'
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
;Function un.onUninstSuccess
; HideWindow
;MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
;FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" /SD IDYES IDYES +2
Abort
FunctionEnd
Section Uninstall
SetOutPath '$TEMP'
SetOverwrite on
DetailPrint 'Add GACUtil.exe to $TEMP'
File 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\GacUtil.exe'
File 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe.config'
File 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\1033\gacutlrc.dll'
DetailPrint 'Unregister MultipleHash'
nsExec::ExecToLog '$TEMP\gacutil.exe /u MultipleHash2012'
DetailPrint 'Delete GACUtil.exe From $TEMP'
Delete "$TEMP\gacutil.exe"
Delete "$TEMP\gacutil.exe.config"
Delete "$TEMP\gacutlrc.dll"
DetailPrint 'Delete $INSTDIR\Uninst.exe'
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\install.log"
RMDir "$INSTDIR"
SetRegView 32
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Microsoft SQL Server\110\SSIS\Setup\DTSPath" ""
DetailPrint 'Delete $0\PipelineComponents\MultipleHash2012.dll'
Delete "$0\PipelineComponents\MultipleHash2012.dll"
Delete "$0\UpgradeMappings\SSISMHash.xml"
SetRegView 64
ReadRegStr $1 HKLM "SOFTWARE\Microsoft\Microsoft SQL Server\110\SSIS\Setup\DTSPath" ""
StrCmp $0 $1 +4 0
DetailPrint 'Delete $1\PipelineComponents\MultipleHash2012.dll'
Delete "$1\PipelineComponents\MultipleHash2012.dll"
Delete "$1\UpgradeMappings\SSISMHash.xml"
SetRegView 32
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
SetAutoClose false
SectionEnd