17
17
Unicode true
18
18
19
19
SetCompressor /SOLID lzma
20
+ RequestExecutionLevel admin
20
21
21
22
!define PRODUCT_NAME " sACNView64"
22
23
!define PRODUCT_PUBLISHER " Tom Steer"
@@ -69,23 +70,6 @@ InstallDirRegKey ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "InstallDir"
69
70
70
71
!insertmacro MUI_PAGE_WELCOME
71
72
72
- ; Check for Admin rights
73
- Section CheckAdmin
74
- DetailPrint " Checking Admin Rights"
75
- System::Call " kernel32::GetModuleHandle(t 'shell32.dll') i .s"
76
- System::Call " kernel32::GetProcAddress(i s, i 680) i .r0"
77
- System::Call " ::$0() i .r0"
78
-
79
- IntCmp $0 0 isNotAdmin isNotAdmin isAdmin
80
- isNotAdmin:
81
- DetailPrint " Missing Administrator Rights !!!"
82
- messageBox MB_OK " You do not have Administrator rights on this computer.$\r$\r \
83
- Please log in as an administrator to install sACNView."
84
- quit
85
- isAdmin:
86
- DetailPrint " Administrator Rights granted"
87
- SectionEnd
88
-
89
73
!insertmacro MUI_PAGE_DIRECTORY
90
74
!insertmacro MUI_PAGE_INSTFILES
91
75
!define MUI_FINISHPAGE_RUN $INSTDIR \sACNView.exe
@@ -132,8 +116,13 @@ Section "Main Application" sec01
132
116
; Same as create shortcut you need to use ${UNINST_EXE} instead of anything else.
133
117
WriteRegStr ${INSTDIR_REG_ROOT} " ${INSTDIR_REG_KEY}" " UninstallString" " ${UNINST_EXE}"
134
118
135
- ; Add firewall exception
136
- SimpleFC::AddApplication ${PRODUCT_NAME} " $INSTDIR\sACNView.exe" 0 2 " " 1
119
+ DetailPrint " Adding Firewall Exception"
120
+ ; rule_name, description, protocol, direction,
121
+ ; status, profiles, action, application,
122
+ ; service_name, icmp_types_and_codes, group, local_ports, remote_ports, local_address, remote_address
123
+ SimpleFC::AdvAddRule ${PRODUCT_NAME} " ${PRODUCT_NAME} UDP Multicast Receive" " 17" \
124
+ " 1" " 1" " 2147483647" " 1" " $INSTDIR\sACNView.exe" \
125
+ " " " " " @$INSTDIR\sACNView.exe,-10000" " " " " " " " "
137
126
Pop $0
138
127
139
128
IntCmp $0 0 fw_ok
@@ -176,22 +165,26 @@ Section UnInstall
176
165
; Use the 64bit registry
177
166
SetRegView 64
178
167
179
- ; begin uninstall, especially for MUI could be added in UN.onInit function instead
180
- ; !insertmacro UNINSTALL.LOG_BEGIN_UNINSTALL
168
+ ; uninstall from path, must be repeated for every install logged path individual
169
+ !insertmacro UNINSTALL.LOG_UNINSTALL " $INSTDIR"
170
+
171
+ ; end uninstall, after uninstall from all logged paths has been performed
172
+ !insertmacro UNINSTALL.LOG_END_UNINSTALL
181
173
182
- ; uninstall from path, must be repeated for every install logged path individual
183
- !insertmacro UNINSTALL.LOG_UNINSTALL " $INSTDIR "
174
+ Delete " $SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk "
175
+ RmDir " $SMPROGRAMS\${PRODUCT_NAME} "
184
176
185
- ; end uninstall, after uninstall from all logged paths has been performed
186
- !insertmacro UNINSTALL.LOG_END_UNINSTALL
177
+ ; Remove firewall exception
178
+ SimpleFC::AdvRemoveRule ${PRODUCT_NAME}
187
179
188
- Delete " $SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk"
189
- RmDir " $SMPROGRAMS\${PRODUCT_NAME}"
190
-
191
- ; Remove firewall exception
192
- SimpleFC::RemoveApplication " $INSTDIR\sACNView.exe"
180
+ DeleteRegValue ${INSTDIR_REG_ROOT} " ${INSTDIR_REG_KEY}" " InstallDir"
181
+ DeleteRegValue ${INSTDIR_REG_ROOT} " ${INSTDIR_REG_KEY}" " DisplayIcon"
182
+ DeleteRegValue ${INSTDIR_REG_ROOT} " ${INSTDIR_REG_KEY}" " DisplayName"
183
+ DeleteRegValue ${INSTDIR_REG_ROOT} " ${INSTDIR_REG_KEY}" " DisplayVersion"
184
+ DeleteRegValue ${INSTDIR_REG_ROOT} " ${INSTDIR_REG_KEY}" " Publisher"
185
+ DeleteRegValue ${INSTDIR_REG_ROOT} " ${INSTDIR_REG_KEY}" " UninstallString"
193
186
194
- DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} " ${INSTDIR_REG_KEY}"
187
+ DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} " ${INSTDIR_REG_KEY}"
195
188
196
189
SectionEnd
197
190
@@ -200,7 +193,7 @@ Function UN.onInit
200
193
; Use the 64bit registry
201
194
SetRegView 64
202
195
203
- ; begin uninstall, could be added on top of uninstall section instead
204
- !insertmacro UNINSTALL.LOG_BEGIN_UNINSTALL
196
+ ; begin uninstall, could be added on top of uninstall section instead
197
+ !insertmacro UNINSTALL.LOG_BEGIN_UNINSTALL
205
198
206
199
FunctionEnd
0 commit comments