ui_laser_setup.nsh 123 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865
  1. 
  2. !include "StrFunc.nsh"
  3. !include "WordFunc.nsh"
  4. ${StrRep}
  5. ${StrStr}
  6. !include "LogicLib.nsh"
  7. !include "nsDialogs.nsh"
  8. !include "common.nsh"
  9. !include "x64.nsh"
  10. !include "MUI2.nsh"
  11. !include "WinVer.nsh"
  12. !include "commonfunc.nsh"
  13. !define MB_OK 0x00000000L
  14. !include "FileFunc.nsh"
  15. VIProductVersion "${PRODUCT_VERSION}"
  16. VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
  17. VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
  18. VIAddVersionKey "CompanyName" "${PRODUCT_PUBLISHER}"
  19. VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}"
  20. VIAddVersionKey "InternalName" "${EXE_NAME}"
  21. VIAddVersionKey "FileDescription" "${PRODUCT_NAME}"
  22. VIAddVersionKey "LegalCopyright" "${PRODUCT_LEGAL}"
  23. !define INSTALL_PAGE_REG 0
  24. !define INSTALL_PAGE_CONFIG 1
  25. ;!define INSTALL_PAGE_LICENSE 1
  26. !define INSTALL_PAGE_PROCESSING 2
  27. !define INSTALL_PAGE_FINISH 3
  28. !define INSTALL_PAGE_UNISTCONFIG 4
  29. !define INSTALL_PAGE_UNISTPROCESSING 5
  30. !define INSTALL_PAGE_UNISTFINISH 6
  31. Page custom DUIPage
  32. UninstPage custom un.DUIPage
  33. Var hInstallDlg
  34. Var hInstallSubDlg
  35. Var sSetupPath
  36. Var sReserveData
  37. Var InstallState
  38. Var UnInstallValue
  39. Var basedir
  40. Var datadir
  41. Var logError
  42. Var buildModelPath
  43. Var profilePath
  44. Var buildCallPath
  45. Var dbpath
  46. Var logpath
  47. Var binPath
  48. Var javaPath
  49. Var OLD_VER
  50. Var vc_flag
  51. Var IREAL_PATH
  52. Var SMART3D_PATH
  53. Var reboot_flag
  54. Var update
  55. !include "ui_laser_lang.nsi"
  56. Function SelectLanguage
  57. ;根据windowsapi返回值选择语言,不支持语言默认显示英文
  58. System::Call 'Kernel32::GetUserDefaultUILanguage() i.r0'
  59. ${If} $0 == '1033'
  60. StrCpy $LANGUAGE 1033
  61. ${ElseIf} $0 == '1041'
  62. StrCpy $LANGUAGE 1041
  63. ${ElseIf} $0 == '1042'
  64. StrCpy $LANGUAGE 1042
  65. ${ElseIf} $0 == '2052'
  66. StrCpy $LANGUAGE 2052
  67. ${Else}
  68. StrCpy $LANGUAGE 1033
  69. ${EndIf}
  70. FunctionEnd
  71. Function langSelectPush
  72. Push ""
  73. ; Start dynamic language pushing
  74. StrCpy $0 0
  75. ; Get the length of LANG_LIST
  76. StrLen $1 ${LANG_LIST}
  77. loop:
  78. ; If we reached the end of the list, exit the loop
  79. IntCmp $0 $1 done
  80. ; Get the next language code (2 characters)
  81. StrCpy $2 ${LANG_LIST} 2 $0
  82. ; Determine the language and push its code and name
  83. ${If} $2 == "zh"
  84. Push ${LANG_SIMPCHINESE}
  85. Push "简体中文"
  86. ${ElseIf} $2 == "en"
  87. Push ${LANG_ENGLISH}
  88. Push "English"
  89. ${ElseIf} $2 == "ja"
  90. Push ${LANG_JAPANESE}
  91. Push "日本語"
  92. ${ElseIf} $2 == "kr"
  93. Push ${LANG_KOREAN}
  94. Push "한국어"
  95. ${ElseIf} $2 == ""
  96. Goto done
  97. ${EndIf}
  98. ; Move to the next language code in the list
  99. IntOp $0 $0 + 3
  100. ; Loop again
  101. Goto loop
  102. done:
  103. FunctionEnd
  104. ;在安装程序运行前的回调函数前实现
  105. Function .onInit
  106. ;Debug::Watcher
  107. Call SelectLanguage
  108. Call checkInstall
  109. Call langSelectPush
  110. ;MessageBox mb_ok "$0-------$LANGUAGE"
  111. Push A ; A means auto count languages for the auto count to work the first empty push (Push "") must remain
  112. ${If} $LANGUAGE == '2052'
  113. LangDLL::LangDialog "安装程序语言" "请选择安装程序的语言" ;显示语言选择对话框
  114. ${ElseIf} $LANGUAGE == '1033'
  115. LangDLL::LangDialog "Installer Language" "Please select the language of the installer" ;显示语言选择对话框
  116. ${ElseIf} $LANGUAGE == '1041'
  117. LangDLL::LangDialog "インストーラ言語" "インストーラの言語を選択してください" ;显示语言选择对话框
  118. ${ElseIf} $LANGUAGE == '1042'
  119. LangDLL::LangDialog "설치 프로그램 언어" "설치 프로그램의 언어를 선택하십시오" ;显示语言选择对话框
  120. ${Else}
  121. LangDLL::LangDialog "Installer Language" "Please select the language of the installer" ;显示语言选择对话框
  122. ${EndIf}
  123. Pop $LANGUAGE ;获得用户对于语言的选择结果 ‘$LANGUAGE’是多语言变量,在安装程序结束后,语言代码会存储在这个变量中,手动修改‘$LANGUAGE’的值后,安装包会重新选择最匹配的语言,参考最上面NSIS手册中选择界面语言步骤
  124. StrCmp $LANGUAGE "cancel" 0 +2
  125. Abort
  126. ${If} $LANGUAGE == '1033'
  127. Call startCheckEn
  128. ${ElseIf} $LANGUAGE == '1041'
  129. Call startCheckJp
  130. ${ElseIf} $LANGUAGE == '1042'
  131. Call startCheckKr
  132. ${ElseIf} $LANGUAGE == '2052'
  133. Call startCheck
  134. ${Else}
  135. Call startCheckEn
  136. ${EndIf}
  137. FunctionEnd
  138. Function checkInstall
  139. System::Call 'kernel32::CreateMutexA(i 0, i 0, t"Winsnap_installer") i .r1 ?e'
  140. Pop $R0
  141. StrCmp $R0 0 SKIP RUN
  142. RUN:
  143. ${If} $LANGUAGE == '1033'
  144. System::Call 'USER32::MessageBox(i $hwndparent, t "An installation wizard is already running, please do not turn it on repeatedly.", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  145. Abort
  146. ${ElseIf} $LANGUAGE == '1041'
  147. System::Call 'USER32::MessageBox(i $hwndparent, t "インストールが既に起動されています。重複起動を避けてください。", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  148. Abort
  149. ${ElseIf} $LANGUAGE == '1042'
  150. System::Call 'USER32::MessageBox(i $hwndparent, t "설치 마법사가 이미 실행 중입니다. 반복적으로 켜지 마십시오.", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  151. Abort
  152. ${ElseIf} $LANGUAGE == '2052'
  153. System::Call 'USER32::MessageBox(i $hwndparent, t "有一个安装向导已经运行,请勿重复打开。", t "3D数字化重建", i ${MB_OK})i .r1'
  154. Abort
  155. ${Else}
  156. System::Call 'USER32::MessageBox(i $hwndparent, t "An installation wizard is already running, please do not turn it on repeatedly.", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  157. Abort
  158. ${EndIf}
  159. Goto END
  160. SKIP:
  161. Goto END
  162. END:
  163. FunctionEnd
  164. Function startCheck
  165. StrCpy $update "1"
  166. ${IfNot} ${AtLeastWin10}
  167. System::Call 'USER32::MessageBox(i $hwndparent, t "本程序只能安装在windows-10(64位)系统及以上", t "3D数字化重建", i ${MB_OK})i .r1'
  168. Abort
  169. ${EndIf}
  170. SetRegView 64
  171. ReadRegStr $OLD_VER HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PATHNAME}" "DisplayVersion"
  172. ${IF} $OLD_VER != ""
  173. ${VersionCompare} $OLD_VER ${PRODUCT_VERSION} $R0
  174. ${If} $R0 == "0"
  175. System::Call 'USER32::MessageBox(i $hwndparent, t "版本 $OLD_VER 已安装在计算机中。如需重新安装,请卸载已有的安装", t "3D数字化重建", i ${MB_OK})i .r1'
  176. Quit
  177. ${EndIf}
  178. ${If} $R0 == "1"
  179. System::Call 'USER32::MessageBox(i $hwndparent, t "版本 $OLD_VER 已安装在计算机中。如需重新安装,请卸载已有的安装", t "3D数字化重建", i ${MB_OK})i .r1'
  180. Quit
  181. ${EndIf}
  182. ${If} $R0 == "2"
  183. System::Call 'USER32::MessageBox(i $hwndparent, t "您安装的版本是 ${PRODUCT_VERSION} ,高于版本 $OLD_VER,可以执行更新操作", t "3D数字化重建", i ${MB_OK})i .r1'
  184. StrCpy $update "0"
  185. ${EndIf}
  186. ${EndIf}
  187. FunctionEnd
  188. Function startCheckEn
  189. StrCpy $update "1"
  190. ${IfNot} ${AtLeastWin10}
  191. System::Call 'USER32::MessageBox(i $hwndparent, t "This program can only be installed on Windows 10 (64-bit) and updated systems.", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  192. Abort
  193. ${EndIf}
  194. SetRegView 64
  195. ReadRegStr $OLD_VER HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PATHNAME}" "DisplayVersion"
  196. ${IF} $OLD_VER != ""
  197. ${VersionCompare} $OLD_VER ${PRODUCT_VERSION} $R0
  198. ${If} $R0 == "0"
  199. System::Call 'USER32::MessageBox(i $hwndparent, t "Version $OLD_VER is installed on the computer. To reinstall,please uninstall the existing version first.", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  200. Quit
  201. ${EndIf}
  202. ${If} $R0 == "1"
  203. System::Call 'USER32::MessageBox(i $hwndparent, t "Version $OLD_VER is installed on the computer. To reinstall,please uninstall the existing version first.", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  204. Quit
  205. ${EndIf}
  206. ${If} $R0 == "2"
  207. System::Call 'USER32::MessageBox(i $hwndparent, t "The version you are installing is ${PRODUCT_VERSION}, which is newer than version $OLD_VER, and it can perform the updated operation", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  208. StrCpy $update "0"
  209. ${EndIf}
  210. ${EndIf}
  211. FunctionEnd
  212. Function startCheckKr
  213. StrCpy $update "1"
  214. ${IfNot} ${AtLeastWin10}
  215. System::Call 'USER32::MessageBox(i $hwndparent, t "このプログラムは、 Windows-10(64ビット)システム以上にのみインストールできます。", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  216. Abort
  217. ${EndIf}
  218. SetRegView 64
  219. ReadRegStr $OLD_VER HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PATHNAME}" "DisplayVersion"
  220. ${IF} $OLD_VER != ""
  221. ${VersionCompare} $OLD_VER ${PRODUCT_VERSION} $R0
  222. ${If} $R0 == "0"
  223. System::Call 'USER32::MessageBox(i $hwndparent, t "$OLD_VER 버전이 컴퓨터에 설치되어 있습니다.다시 설치하려면 먼저 기존 버전을 제거하십시오.", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  224. Quit
  225. ${EndIf}
  226. ${If} $R0 == "1"
  227. System::Call 'USER32::MessageBox(i $hwndparent, t "$OLD_VER 버전이 컴퓨터에 설치되어 있습니다.다시 설치하려면 먼저 기존 버전을 제거하십시오.", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  228. Quit
  229. ${EndIf}
  230. ${If} $R0 == "2"
  231. System::Call 'USER32::MessageBox(i $hwndparent, t "설치하는 버전은 $OLD_VER 버전보다 최신 버전인 ${PRODUCT_VERSION} 이며 업데이트된 작업을 수행할 수 있습니다.", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  232. StrCpy $update "0"
  233. ${EndIf}
  234. ${EndIf}
  235. FunctionEnd
  236. Function startCheckJp
  237. StrCpy $update "1"
  238. ${IfNot} ${AtLeastWin10}
  239. System::Call 'USER32::MessageBox(i $hwndparent, t "このプログラムは、 Windows-10(64ビット)システム以上にのみインストールできます。", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  240. Abort
  241. ${EndIf}
  242. SetRegView 64
  243. ReadRegStr $OLD_VER HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PATHNAME}" "DisplayVersion"
  244. ${IF} $OLD_VER != ""
  245. ${VersionCompare} $OLD_VER ${PRODUCT_VERSION} $R0
  246. ${If} $R0 == "0"
  247. System::Call 'USER32::MessageBox(i $hwndparent, t "バージョン $OLD_VER が既にインストールされていました。再インストールするには、既存のインストールをアンインストールしてください。", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  248. Quit
  249. ${EndIf}
  250. ${If} $R0 == "1"
  251. System::Call 'USER32::MessageBox(i $hwndparent, t "バージョン $OLD_VER が既にインストールされていました。再インストールするには、既存のインストールをアンインストールしてください。", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  252. Quit
  253. ${EndIf}
  254. ${If} $R0 == "2"
  255. System::Call 'USER32::MessageBox(i $hwndparent, t "現在インストールのバージョン:${PRODUCT_VERSION}、バージョン $OLD_VER より新しいです。アップデートが可能です。", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  256. StrCpy $update "0"
  257. ${EndIf}
  258. ${EndIf}
  259. FunctionEnd
  260. Function un.checkInstall
  261. SetRegView 64
  262. # 调用PowerShell命令添加排除目录
  263. nsExec::ExecToStack 'powershell -Command "Add-MpPreference -ExclusionPath "$PLUGINSDIR""'
  264. nsExec::ExecToStack 'powershell -Command "Add-MpPreference -ExclusionPath "$EXEDIR""'
  265. ReadRegStr $LANGUAGE HKLM "Software\${PRODUCT_PATHNAME}" "language"
  266. System::Call 'kernel32::CreateMutexA(i 0, i 0, t"Winsnap_installer") i .r1 ?e'
  267. Pop $R0
  268. StrCmp $R0 0 SKIP RUN
  269. RUN:
  270. ${If} $LANGUAGE == '1033'
  271. System::Call 'USER32::MessageBox(i $hwndparent, t "An installation wizard is already running, please do not turn it on repeatedly.", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  272. Abort
  273. ${ElseIf} $LANGUAGE == '1041'
  274. System::Call 'USER32::MessageBox(i $hwndparent, t "インストールが既に起動されています。重複起動を避けてください。", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  275. Abort
  276. ${ElseIf} $LANGUAGE == '1042'
  277. System::Call 'USER32::MessageBox(i $hwndparent, t "설치 마법사가 이미 실행 중입니다. 반복적으로 켜지 마십시오.", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  278. Abort
  279. ${ElseIf} $LANGUAGE == '2052'
  280. System::Call 'USER32::MessageBox(i $hwndparent, t "有一个安装向导已经运行,请勿重复打开。", t "3D数字化重建", i ${MB_OK})i .r1'
  281. Abort
  282. ${Else}
  283. System::Call 'USER32::MessageBox(i $hwndparent, t "An installation wizard is already running, please do not turn it on repeatedly.", t "4DKanKan offline Version", i ${MB_OK})i .r1'
  284. Abort
  285. ${EndIf}
  286. Goto END
  287. SKIP:
  288. Goto END
  289. END:
  290. FunctionEnd
  291. Function un.onInit
  292. ;Debug::Watcher
  293. SetRegView 64
  294. # 调用PowerShell命令添加排除目录
  295. nsExec::ExecToStack 'powershell -Command "Add-MpPreference -ExclusionPath "$PLUGINSDIR""'
  296. nsExec::ExecToStack 'powershell -Command "Add-MpPreference -ExclusionPath "$EXEDIR""'
  297. ;MessageBox MB_OK "Exit code:$PLUGINSDIR"
  298. Call un.checkInstall
  299. FunctionEnd
  300. Function DUIPage
  301. StrCpy $InstallState "0"
  302. InitPluginsDir
  303. SetOutPath "$PLUGINSDIR"
  304. # 调用PowerShell命令添加排除目录
  305. nsExec::ExecToStack 'powershell -Command "Add-MpPreference -ExclusionPath "$PLUGINSDIR""'
  306. File "${INSTALL_LICENCE_FILENAME_ZH}"
  307. File "${INSTALL_LICENCE_FILENAME_EN}"
  308. File "${INSTALL_RES_PATH}"
  309. File /oname=logo.ico "${INSTALL_ICO}"
  310. ; File /oname=4dage.exe "${INSTALL_REG}"
  311. StrCmp $LANGUAGE 2052 ZH_INI EN_INI
  312. EN_INI:
  313. nsNiuniuSkin::InitSkinPage "$PLUGINSDIR\" "${INSTALL_LICENCE_FILENAME_EN}"
  314. Goto END
  315. ZH_INI:
  316. nsNiuniuSkin::InitSkinPage "$PLUGINSDIR\" "${INSTALL_LICENCE_FILENAME_ZH}"
  317. Goto END
  318. END:
  319. Pop $hInstallDlg
  320. ; MessageBox MB_OK "Exit code:$machine"
  321. Call initConfigPage
  322. Call BindUIControls
  323. ;设置安装包的标题及任务栏显示
  324. nsNiuniuSkin::SetWindowTile $hInstallDlg "$(PRODUCT_NAME_LANG)$(SETUP)"
  325. nsExec::ExecToStack 'cmd.exe /c powercfg.exe /hibernate on '
  326. ${If} $update == "1"
  327. ;新装
  328. ;生成安装路径,包含识别旧的安装路径
  329. Call GenerateSetupAddress
  330. #设置控件显示安装路径
  331. nsNiuniuSkin::SetControlAttribute $hInstallDlg "editDir" "text" "$INSTDIR\"
  332. Call OnRichEditTextChange
  333. #nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnAgreement" "text" " 用户许可协议"
  334. ${Else}
  335. ;更新
  336. SetRegView 64
  337. ReadRegStr $0 HKLM "Software\${PRODUCT_PATHNAME}" "InstPath"
  338. ${If} "$0" != "" #路径不存在,则重新选择路径
  339. #路径读取到了,直接使用
  340. #再判断一下这个路径是否有效
  341. nsNiuniuSkin::StringHelper "$0" "\\" "\" "replace"
  342. Pop $0
  343. StrCpy $INSTDIR "$0"
  344. ${EndIf}
  345. #设置控件显示安装路径
  346. nsNiuniuSkin::SetControlAttribute $hInstallDlg "editDir" "text" "$INSTDIR\"
  347. Call OnRichEditTextChange
  348. nsNiuniuSkin::SetControlAttribute $hInstallDlg "editDir" "enabled" "false"
  349. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnSelectDir" "visible" "false"
  350. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "text" $(ONE_CLICK_UPDATE)
  351. ${EndIf}
  352. nsNiuniuSkin::ShowPageItem $hInstallDlg "wizardTab" ${INSTALL_PAGE_CONFIG}
  353. nsNiuniuSkin::SetControlAttribute $hInstallDlg "licensename" "text" $(USER_LICENSE_AGREEMENT)
  354. nsNiuniuSkin::ShowPage 0
  355. FunctionEnd
  356. Function un.DUIPage
  357. StrCpy $InstallState "0"
  358. InitPluginsDir
  359. SetOutPath "$PLUGINSDIR"
  360. File "${INSTALL_RES_PATH}"
  361. File /oname=logo.ico "${UNINSTALL_ICO}"
  362. nsNiuniuSkin::InitSkinPage "$PLUGINSDIR\" ""
  363. Pop $hInstallDlg
  364. nsNiuniuSkin::ShowPageItem $hInstallDlg "wizardTab" ${INSTALL_PAGE_UNISTCONFIG}
  365. Call un.initUnInstallPage
  366. nsNiuniuSkin::SetWindowTile $hInstallDlg "$(PRODUCT_NAME_LANG)$(UNINSTALL_SETUP)"
  367. nsNiuniuSkin::SetWindowSize $hInstallDlg 480 390s
  368. Call un.BindUnInstUIControls
  369. nsNiuniuSkin::SetControlAttribute $hInstallDlg "chkAutoRun" "selected" "true"
  370. nsNiuniuSkin::ShowPage 0
  371. FunctionEnd
  372. Function un.BindUnInstUIControls
  373. GetFunctionAddress $0 un.ExitDUISetup
  374. nsNiuniuSkin::BindCallBack $hInstallDlg "btnUninstalled" $0
  375. GetFunctionAddress $0 un.onUninstall
  376. nsNiuniuSkin::BindCallBack $hInstallDlg "btnUnInstall" $0
  377. GetFunctionAddress $0 un.ExitDUISetup
  378. nsNiuniuSkin::BindCallBack $hInstallDlg "btnClose" $0
  379. GetFunctionAddress $0 un.ExitDUISetup
  380. nsNiuniuSkin::BindCallBack $hInstallDlg "btnUnClose" $0
  381. GetFunctionAddress $0 un.OnBtnMin
  382. nsNiuniuSkin::BindCallBack $hInstallDlg "btnFinishedMin" $0
  383. GetFunctionAddress $0 un.BtnDirPre
  384. nsNiuniuSkin::BindCallBack $hInstallDlg "btnDirPre" $0
  385. ; GetFunctionAddress $0 un.onNoPassUninstall
  386. ; nsNiuniuSkin::BindCallBack $hInstallDlg "backupBtnOK" $0
  387. ; GetFunctionAddress $0 un.onPassUninstall
  388. ; nsNiuniuSkin::BindCallBack $hInstallDlg "gotouninstall" $0
  389. GetFunctionAddress $0 un.OnbtnUninstalledReboot
  390. nsNiuniuSkin::BindCallBack $hInstallDlg "btnUninstalledReboot" $0
  391. FunctionEnd
  392. Function BindUIControls
  393. GetFunctionAddress $0 OnExitDUISetup
  394. nsNiuniuSkin::BindCallBack $hInstallDlg "btnLicenseClose" $0
  395. GetFunctionAddress $0 OnBtnMin
  396. nsNiuniuSkin::BindCallBack $hInstallDlg "btnLicenseMin" $0
  397. GetFunctionAddress $0 OnBtnLicenseClick
  398. nsNiuniuSkin::BindCallBack $hInstallDlg "btnAgreement" $0
  399. GetFunctionAddress $0 OnExitDUISetup
  400. nsNiuniuSkin::BindCallBack $hInstallDlg "btnDirClose" $0
  401. GetFunctionAddress $0 OnExitDUISetup
  402. nsNiuniuSkin::BindCallBack $hInstallDlg "btnLicenseCancel" $0
  403. GetFunctionAddress $0 OnBtnMin
  404. nsNiuniuSkin::BindCallBack $hInstallDlg "btnDirMin" $0
  405. GetFunctionAddress $0 OnBtnSelectDir
  406. nsNiuniuSkin::BindCallBack $hInstallDlg "btnSelectDir" $0
  407. GetFunctionAddress $0 OnBtnDirPre
  408. nsNiuniuSkin::BindCallBack $hInstallDlg "btnDirPre" $0
  409. GetFunctionAddress $0 OnBtnShowConfig
  410. nsNiuniuSkin::BindCallBack $hInstallDlg "btnAgree" $0
  411. GetFunctionAddress $0 OnBtnCancel
  412. nsNiuniuSkin::BindCallBack $hInstallDlg "btnDirCancel" $0
  413. GetFunctionAddress $0 OnBtnInstall
  414. nsNiuniuSkin::BindCallBack $hInstallDlg "btnInstall" $0
  415. GetFunctionAddress $0 OnExitDUISetup
  416. nsNiuniuSkin::BindCallBack $hInstallDlg "btnDetailClose" $0
  417. GetFunctionAddress $0 OnBtnMin
  418. nsNiuniuSkin::BindCallBack $hInstallDlg "btnDetailMin" $0
  419. GetFunctionAddress $0 OnFinished
  420. nsNiuniuSkin::BindCallBack $hInstallDlg "btnRun" $0
  421. GetFunctionAddress $0 OnBtnMin
  422. nsNiuniuSkin::BindCallBack $hInstallDlg "btnFinishedMin" $0
  423. GetFunctionAddress $0 OnExitDUISetup
  424. nsNiuniuSkin::BindCallBack $hInstallDlg "btnClose" $0
  425. GetFunctionAddress $0 OnCheckLicenseClick
  426. nsNiuniuSkin::BindCallBack $hInstallDlg "chkAgree" $0
  427. GetFunctionAddress $0 OnBtnShowMore
  428. nsNiuniuSkin::BindCallBack $hInstallDlg "btnShowMore" $0
  429. GetFunctionAddress $0 OnBtnHideMore
  430. nsNiuniuSkin::BindCallBack $hInstallDlg "btnHideMore" $0
  431. GetFunctionAddress $0 OnSysCommandCloseEvent
  432. nsNiuniuSkin::BindCallBack $hInstallDlg "syscommandclose" $0
  433. GetFunctionAddress $0 OnRichEditTextChange
  434. nsNiuniuSkin::BindCallBack $hInstallDlg "editDir" $0
  435. FunctionEnd
  436. Function un.OnbtnUninstalledReboot
  437. ; MessageBox MB_OK "OnbtnUninstalledR:eboot--Reboot"
  438. # 调用PowerShell命令添加排除目录
  439. nsExec::ExecToStack 'powershell -Command "Remove-MpPreference -ExclusionPath "$PLUGINSDIR""'
  440. nsExec::ExecToStack 'powershell -Command "Remove-MpPreference -ExclusionPath "$EXEDIR""'
  441. Reboot
  442. FunctionEnd
  443. Function OnRichEditTextChange
  444. nsNiuniuSkin::GetControlAttribute $hInstallDlg "editDir" "text"
  445. Pop $0
  446. StrCpy $INSTDIR "$0"
  447. Call onVerifyInstDir
  448. Pop $0
  449. ${If} $0 == 1
  450. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" $(CANNOT_CONTAIN_ZH_PATH)
  451. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#ffff0000"
  452. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  453. goto TextChangeAbort
  454. ${EndIf}
  455. ${If} $0 == 2
  456. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" $(PATH_CANNOT_EMPTY)
  457. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#ffff0000"
  458. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  459. goto TextChangeAbort
  460. ${EndIf}
  461. Call onVerifySpecialInstDir
  462. ${If} $0 == 1
  463. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" $(CANNOT_CONTAIN_SPECIAL_CHARACTERS)
  464. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#ffff0000"
  465. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  466. goto TextChangeAbort
  467. ${EndIf}
  468. Call IsSetupPathIlleagal
  469. ${If} $R5 == "0"
  470. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" $(PATH_ERROR)
  471. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#ffff0000"
  472. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  473. goto TextChangeAbort
  474. ${EndIf}
  475. ${If} $R5 == "-1"
  476. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" $(DISK_SPACE_ERROR)
  477. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#ffff0000"
  478. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  479. goto TextChangeAbort
  480. ${EndIf}
  481. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#FF999999"
  482. ${If} $R0 > 1024
  483. IntOp $R1 $R0 % 1024
  484. IntOp $R0 $R0 / 1024;
  485. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" "$(REMAINING_SPACE):$R0.$R1GB"
  486. ${If} $update == "1"
  487. ${If} $R0 < 50
  488. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" $(DISK_SPACE_ERROR)
  489. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#ffff0000"
  490. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  491. ${endif}
  492. ${endif}
  493. ${Else}
  494. ;nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" "$(REMAINING_SPACE):$R0MB"
  495. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" $(DISK_SPACE_ERROR)
  496. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#ffff0000"
  497. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  498. ${endif}
  499. ${IF} ${CJ} == "true"
  500. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "true"
  501. ${Else}
  502. nsNiuniuSkin::GetControlAttribute $hInstallDlg "chkAgree" "selected"
  503. Pop $0
  504. ${If} $0 == "1"
  505. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "true"
  506. ${Else}
  507. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  508. ${EndIf}
  509. ${EndIf}
  510. TextChangeAbort:
  511. FunctionEnd
  512. Function OnCheckLicenseClick
  513. ${IF} ${CJ} == "true"
  514. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "true"
  515. ${Else}
  516. nsNiuniuSkin::GetControlAttribute $hInstallDlg "chkAgree" "selected"
  517. Pop $0
  518. ${If} $0 == "0"
  519. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "true"
  520. ${Else}
  521. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  522. ${EndIf}
  523. ${EndIf}
  524. FunctionEnd
  525. Function OnBtnLicenseClick
  526. ;nsNiuniuSkin::ShowPageItem $hInstallDlg "wizardTab" ${INSTALL_PAGE_LICENSE}
  527. Call initLicensePage
  528. nsNiuniuSkin::SetControlAttribute $hInstallDlg "licenseshow" "visible" "true"
  529. nsNiuniuSkin::GetControlAttribute $hInstallDlg "moreconfiginfo" "visible"
  530. Pop $0
  531. ${If} $0 = 0
  532. ;pos="10,35,560,405"
  533. nsNiuniuSkin::SetControlAttribute $hInstallDlg "licenseshow" "pos" "5,35,475,385"
  534. nsNiuniuSkin::SetControlAttribute $hInstallDlg "editLicense" "height" "270"
  535. ${Else}
  536. nsNiuniuSkin::SetControlAttribute $hInstallDlg "licenseshow" "pos" "5,35,475,495"
  537. nsNiuniuSkin::SetControlAttribute $hInstallDlg "editLicense" "height" "375"
  538. ${EndIf}
  539. FunctionEnd
  540. Section "silentInstallSec" SEC01
  541. #MessageBox MB_OK|MB_ICONINFORMATION "Test silent install. you can add your silent install code here."
  542. SectionEnd
  543. Function ShowMsgBox
  544. nsNiuniuSkin::InitSkinSubPage "msgBox.xml" "btnOK" "btnCancel,btnClose"
  545. Pop $hInstallSubDlg
  546. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "btnOK" "text" $(BTN_CONFIRM)
  547. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "btnCancel" "text" $(BTN_CANCEL)
  548. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "lblTitle" "text" $(PROMPT)
  549. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "lblMsg" "text" "$R8"
  550. ${If} "$R7" == "1"
  551. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "hlCancel" "visible" "true"
  552. ${EndIf}
  553. nsNiuniuSkin::ShowSkinSubPage 0
  554. FunctionEnd
  555. Function OnBtnInstall
  556. ; 调用 PowerShell 来添加排除目录
  557. nsExec::ExecToStack 'powershell -Command "Add-MpPreference -ExclusionPath "$INSTDIR""'
  558. nsNiuniuSkin::GetControlAttribute $hInstallDlg "editDir" "text"
  559. Pop $0
  560. StrCpy $INSTDIR "$0"
  561. Call onVerifyInstDir
  562. Pop $0
  563. ${If} $0 == 1
  564. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" $(CANNOT_CONTAIN_ZH_PATH)
  565. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#ffff0000"
  566. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  567. goto InstallAbort
  568. ${EndIf}
  569. ${If} $0 == 2
  570. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" $(PATH_CANNOT_EMPTY)
  571. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#ffff0000"
  572. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  573. goto InstallAbort
  574. ${EndIf}
  575. Call onVerifySpecialInstDir
  576. ${If} $0 == 1
  577. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" $(CANNOT_CONTAIN_SPECIAL_CHARACTERS)
  578. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#ffff0000"
  579. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  580. goto InstallAbort
  581. ${EndIf}
  582. Call IsSetupPathIlleagal
  583. ${If} $R5 == "0"
  584. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" $(PATH_ERROR)
  585. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#ffff0000"
  586. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  587. goto InstallAbort
  588. ${EndIf}
  589. ${If} $R5 == "-1"
  590. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "text" $(DISK_SPACE_ERROR)
  591. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#ffff0000"
  592. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "enabled" "false"
  593. goto InstallAbort
  594. ${EndIf}
  595. ; MessageBox MB_OK|MB_USERICON '$INSTDIR\install.flag'
  596. SetRegView 64
  597. ReadRegStr $reboot_flag HKLM "Software\${PRODUCT_PATHNAME}" "reboot"
  598. ${If} $reboot_flag == '1'
  599. SetRebootFlag true
  600. System::Call 'USER32::MessageBox(i $hwndparent, t "$(REBOOT_PROMPT)", t "$(PRODUCT_NAME_LANG)", i ${MB_OKCANCEL})i .r1'
  601. Quit
  602. ${EndIf}
  603. nsNiuniuSkin::SetControlAttribute $hInstallDlg "local_space" "textcolor" "#FF999999"
  604. nsNiuniuSkin::GetControlAttribute $hInstallDlg "chkAgree" "selected"
  605. Pop $0
  606. StrCpy $0 "1"
  607. StrCmp $0 "0" InstallAbort 0
  608. nsProcess::_FindProcess "${EXE_NAME_EXT}"
  609. Pop $R0
  610. ${If} $R0 == 0
  611. StrCpy $R8 "$(PRODUCT_NAME_LANG) $(TO_RUNNING)"
  612. StrCpy $R7 "0"
  613. Call ShowMsgBox
  614. goto InstallAbort
  615. ${EndIf}
  616. nsNiuniuSkin::GetControlAttribute $hInstallDlg "editDir" "text"
  617. Pop $0
  618. StrCmp $0 "" InstallAbort 0
  619. Call AdjustInstallPath
  620. StrCpy $sSetupPath "$INSTDIR"
  621. Call IsSetupPathIlleagal
  622. ${If} $R5 == "0"
  623. StrCpy $R8 $(PATH_ERROR_TWO)
  624. StrCpy $R7 "0"
  625. Call ShowMsgBox
  626. goto InstallAbort
  627. ${EndIf}
  628. ${If} $R5 == "-1"
  629. StrCpy $R8 $(DISK_SPACE_ERROR)
  630. StrCpy $R7 "0"
  631. Call ShowMsgBox
  632. goto InstallAbort
  633. ${EndIf}
  634. ${If} $update == "1"
  635. ${If} $R0 > 1024
  636. IntOp $R1 $R0 % 1024
  637. IntOp $R0 $R0 / 1024;
  638. ${If} $R0 < 50
  639. StrCpy $R8 $(DISK_SPACE_ERROR)
  640. StrCpy $R7 "0"
  641. Call ShowMsgBox
  642. goto InstallAbort
  643. ${endif}
  644. ${Else}
  645. StrCpy $R8 $(DISK_SPACE_ERROR)
  646. StrCpy $R7 "0"
  647. Call ShowMsgBox
  648. goto InstallAbort
  649. ${endif}
  650. ${EndIf}
  651. nsNiuniuSkin::SetWindowSize $hInstallDlg 480 390
  652. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnClose" "enabled" "false"
  653. Call initInstallingPage
  654. nsNiuniuSkin::ShowPageItem $hInstallDlg "wizardTab" ${INSTALL_PAGE_PROCESSING}
  655. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrProgress" "min" "0"
  656. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrProgress" "max" "100"
  657. #Call BakFiles
  658. ${If} $update == "1"
  659. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(INSTALLING)
  660. ${Else}
  661. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(STOPPING_SERVICE)
  662. SimpleSC::StopService "lasermongodb" 0 30
  663. SimpleSC::StopService "lasermysql" 0 30
  664. SimpleSC::StopService "laserredis" 0 30
  665. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(REMOVE_FILES)
  666. RMDir /r "$INSTDIR\bin"
  667. BgWorker::CallAndWait
  668. RMDir /r "$INSTDIR\CGAII"
  669. Sleep 2000
  670. BgWorker::CallAndWait
  671. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(UPDATING)
  672. ${EndIf}
  673. GetFunctionAddress $0 ExtractFunc
  674. BgWorker::CallAndWait
  675. nsNiuniuSkin::GetControlAttribute $hInstallDlg "chkShotcut" "selected"
  676. #Pop $R0
  677. # ${If} $R0 == "1"
  678. # SetShellVarContext all
  679. # CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\${EXE_NAME}"
  680. # SetShellVarContext current
  681. # ${EndIf}
  682. SetOutPath "$INSTDIR\bin"
  683. SetShellVarContext all
  684. Delete "$DESKTOP\3D数字化重建.lnk"
  685. Delete "$DESKTOP\4DKanKan.lnk"
  686. Delete "$DESKTOP\3D数字化重建.lnk"
  687. CreateShortCut "$DESKTOP\$(PRODUCT_NAME_LANG_LNK).lnk" "$INSTDIR\${EXE_NAME}"
  688. SetShellVarContext current
  689. Call CreateAppShortcut
  690. Call CreateUninstall
  691. ${If} $update == "1"
  692. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(INITIALIZING)
  693. GetFunctionAddress $0 OnEnvInstall
  694. BgWorker::CallAndWait
  695. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(INITIALIZING_SERVICE)
  696. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_pos" "text" ""
  697. GetFunctionAddress $0 installService
  698. BgWorker::CallAndWait
  699. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(INITIALIZING_SERVICE_DONE)
  700. ${Else}
  701. SimpleSC::StartService "lasermongodb" "" 30
  702. SimpleSC::StartService "lasermysql" "" 30
  703. SimpleSC::StartService "laserredis" "" 30
  704. ;nsExec::ExecToStack '"cmd.exe" /c sc failure lasermongodb reset= 43200 actions= restart/60000/restart/86400//86400'
  705. ;nsExec::ExecToStack '"cmd.exe" /c sc failure laserredis reset= 43200 actions= restart/60000/restart/86400//86400'
  706. ;nsExec::ExecToStack '"cmd.exe" /c sc failure lasermysql reset= 43200 actions= restart/60000/restart/86400//86400'
  707. Sleep 2000
  708. ;
  709. ${StrRep} $0 '$INSTDIR\4DKK_PROGRAM_DATA\' '\' '\\'
  710. StrCpy $buildModelPath $0
  711. ${StrRep} $0 '$INSTDIR\4DKK_PROGRAM_STATIC\' '\' '\\'
  712. StrCpy $profilePath $0
  713. ${StrRep} $0 '$INSTDIR\CGAII' '\' '\\'
  714. StrCpy $buildCallPath $0
  715. ${StrRep} $0 '$INSTDIR\bin\resources\static' '\' '\\'
  716. StrCpy $binPath $0
  717. ${StrRep} $0 '$INSTDIR\jdk1.8\bin\java.exe' '\' '\\'
  718. StrCpy $javaPath $0
  719. ${StrRep} $0 '$INSTDIR\iReal3D\iReal3D.exe' '\' '\\'
  720. StrCpy $IREAL_PATH $0
  721. ${StrRep} $0 '$INSTDIR\smart3D\smart3D.exe' '\' '\\'
  722. StrCpy $SMART3D_PATH $0
  723. nsJSON::Set /file $INSTDIR\bin\resources\static\setting.json
  724. nsJSON::Set /value `{}`
  725. nsJSON::Set `sceneConfig` /value `"config.json"`
  726. nsJSON::Set `sceheKey` /value `"id"`
  727. nsJSON::Set `sceneBundle` /value `"./build.zip"`
  728. nsJSON::Set `sceneBundleDir` /value `"capture"`
  729. nsJSON::Set `buildModelPath` /value `"$buildModelPath"`
  730. nsJSON::Set `javaPort` /value `9000`
  731. nsJSON::Set `v4JavaPort` /value `9101`
  732. nsJSON::Set `javaPath` /value `"$javaPath"`
  733. nsJSON::Set `profilePath` /value `"$profilePath"`
  734. nsJSON::Set `buildCallPath` /value `"$buildCallPath"`
  735. nsJSON::Set `binPath` /value `"$binPath"`
  736. nsJSON::Set `fuse` /value `${FUSE}`
  737. nsJSON::Set `ver` /value `${VER}`
  738. nsJSON::Set `version` /value `"${VERSION}"`
  739. nsJSON::Set `isShowIreal` /value `${IS_SHOW_IREAL}`
  740. nsJSON::Set `isShowSmart3D` /value `${IS_SHOW_SMART3D}`
  741. nsJSON::Set `iReal` /value `"$IREAL_PATH"`
  742. nsJSON::Set `smart3D` /value `"$SMART3D_PATH"`
  743. nsJSON::Set `langList` /value `"${LANG_LIST}"`
  744. nsJSON::Serialize /format /file $INSTDIR\bin\resources\static\setting.json
  745. nsExec::ExecToStack '"$INSTDIR\tools\update.bat" $INSTDIR '
  746. ;nsExec::ExecToStack "$INSTDIR\tools\laserOtherTools.exe -m u -i $INSTDIR"
  747. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(UPDATING_DONE)
  748. ${EndIf}
  749. StrCpy $InstallState "1"
  750. Call initFinishPage
  751. nsNiuniuSkin::ShowPageItem $hInstallDlg "wizardTab" ${INSTALL_PAGE_FINISH}
  752. #Call OnFinished
  753. ${If} $update == "0"
  754. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnRun" "text" $(UPDATING_DONE)
  755. ${EndIf}
  756. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnClose" "enabled" "true"
  757. ;完成安装删除计划任务
  758. nsExec::ExecToStack 'ie4uinit.exe -ClearIconCache'
  759. nsExec::ExecToStack 'ie4uinit.exe -show'
  760. System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
  761. ${RefreshShellIcons}
  762. WriteRegStr HKLM "Software\${PRODUCT_PATHNAME}" "language" $LANGUAGE
  763. InstallAbort:
  764. FunctionEnd
  765. Function ExtractCallback
  766. Pop $1
  767. Pop $2
  768. System::Int64Op $1 * 100
  769. Pop $3
  770. System::Int64Op $3 / $2
  771. Pop $0
  772. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrProgress" "value" "$0"
  773. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_pos" "text" "$0%"
  774. ${If} $1 == $2
  775. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrProgress" "value" "100"
  776. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_pos" "text" "100%"
  777. ${EndIf}
  778. FunctionEnd
  779. Function OnSysCommandCloseEvent
  780. Call OnExitDUISetup
  781. FunctionEnd
  782. Function OnExitDUISetup
  783. ${If} $InstallState == "0"
  784. StrCpy $R8 "$(CONFIRM_EXIT)"
  785. StrCpy $R7 "1"
  786. Call ShowMsgBox
  787. pop $0
  788. ${If} $0 == 0
  789. goto endfun
  790. ${EndIf}
  791. ${EndIf}
  792. nsNiuniuSkin::ExitDUISetup
  793. endfun:
  794. FunctionEnd
  795. Function OnBtnMin
  796. SendMessage $hInstallDlg ${WM_SYSCOMMAND} 0xF020 0
  797. FunctionEnd
  798. Function OnBtnCancel
  799. nsNiuniuSkin::ExitDUISetup
  800. FunctionEnd
  801. Function OnEnvInstall
  802. EnVar::SetHKLM
  803. EnVar::AddValue FDMGEA_HOME "$INSTDIR"
  804. ;EnVar::SetHKLM
  805. ;EnVar::AddValue JAVA_HOME "$INSTDIR\jdk1.8"
  806. EnVar::SetHKLM
  807. EnVar::AddValue MYSQL_HOME "$INSTDIR\mysql"
  808. EnVar::SetHKLM
  809. EnVar::AddValue REDIS_HOME "$INSTDIR\redis"
  810. EnVar::SetHKLM
  811. EnVar::AddValue 4DKK_HOME "$INSTDIR\CGAII;$INSTDIR\CGAII\3dtile"
  812. EnVar::SetHKLM
  813. EnVar::AddValue MONGODB_HOME "$INSTDIR\mongodb"
  814. ;EnVar::SetHKLM
  815. ;EnVar::AddValue CLASS_PATH ".;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar"
  816. EnVar::SetHKLM
  817. ;EnVar::AddValue "Path" "$INSTDIR\jdk1.8\bin;$INSTDIR\mysql\bin;$INSTDIR\mongodb\bin;$INSTDIR\redis;$INSTDIR\CGAII;$INSTDIR\CGAII\lib;"
  818. EnVar::AddValue "Path" "$INSTDIR\mysql\bin;$INSTDIR\mongodb\bin;$INSTDIR\redis;$INSTDIR\CGAII;$INSTDIR\CGAII\lib;$INSTDIR\CGAII\3dtile"
  819. SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
  820. ;nsExec::ExecToStack '"$INSTDIR\tools\env_install.bat" $INSTDIR '
  821. FunctionEnd
  822. Function un.OnEnvDownInstall
  823. EnVar::SetHKLM
  824. EnVar::Delete "FDMGEA_HOME" "$INSTDIR"
  825. ;EnVar::Delete "JAVA_HOME" "$INSTDIR\jdk1.8"
  826. EnVar::Delete "MYSQL_HOME" "$INSTDIR\mysql"
  827. EnVar::Delete "REDIS_HOME" "$INSTDIR\redis"
  828. EnVar::Delete "4DKK_HOME" "$INSTDIR\CGAII"
  829. EnVar::Delete "4DKK_HOME" "$INSTDIR\CGAII\3dtile"
  830. EnVar::Delete "MONGODB_HOME" "$INSTDIR\mongodb"
  831. ;EnVar::Delete "CLASS_PATH" "%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar"
  832. ;EnVar::DeleteValue "PATH" "%JAVA_HOME%\bin"
  833. EnVar::DeleteValue "PATH" "$INSTDIR\mysql\bin"
  834. EnVar::DeleteValue "PATH" "$INSTDIR\mongodb\bin"
  835. EnVar::DeleteValue "PATH" "$INSTDIR\redis"
  836. EnVar::DeleteValue "PATH" "$INSTDIR\CGAII"
  837. EnVar::DeleteValue "PATH" "$INSTDIR\CGAII\lib"
  838. EnVar::DeleteValue "PATH" "$INSTDIR\CGAII\3dtile"
  839. ;nsExec::ExecToStack '"$INSTDIR\tools\uninstall.bat" $INSTDIR '
  840. FunctionEnd
  841. Function un.installService
  842. nsExec::ExecToStack '"$INSTDIR\tools\unservice.bat" $INSTDIR '
  843. SimpleSC::ExistsService "lasermongodb"
  844. Pop $0
  845. ${If} $0 == 0
  846. SimpleSC::StopService "lasermongodb" 0 30
  847. SimpleSC::RemoveService "lasermongodb"
  848. ${EndIf}
  849. SimpleSC::ExistsService "lasermysql"
  850. Pop $0
  851. ${If} $0 == 0
  852. SimpleSC::StopService "lasermysql" 0 30
  853. SimpleSC::RemoveService "lasermysql"
  854. ${EndIf}
  855. SimpleSC::ExistsService "laserredis"
  856. Pop $0
  857. ${If} $0 == 0
  858. SimpleSC::StopService "laserredis" 0 30
  859. SimpleSC::RemoveService "laserredis"
  860. ${EndIf}
  861. SimpleSC::ExistsService "checkLaserProcess"
  862. Pop $0
  863. ${If} $0 == 0
  864. SimpleSC::StopService "checkLaserProcess" 0 30
  865. SimpleSC::RemoveService "checkLaserProcess"
  866. ${EndIf}
  867. FunctionEnd
  868. Function installService
  869. ${StrRep} $0 '$INSTDIR\mysql' '\' '\\'
  870. StrCpy $basedir $0
  871. ${StrRep} $0 '$INSTDIR\mysql\data' '\' '\\'
  872. StrCpy $datadir $0
  873. ${StrRep} $0 '$INSTDIR\mysql\logs.log' '\' '\\'
  874. StrCpy $logError $0
  875. WriteINIStr $INSTDIR\mysql\my.ini mysqld port 3307
  876. WriteINIStr $INSTDIR\mysql\my.ini mysqld basedir $basedir
  877. WriteINIStr $INSTDIR\mysql\my.ini mysqld datadir $datadir
  878. WriteINIStr $INSTDIR\mysql\my.ini mysqld log-error $logError
  879. WriteINIStr $INSTDIR\mysql\my.ini mysqld max_connections 1000
  880. WriteINIStr $INSTDIR\mysql\my.ini mysqld max_connect_errors 10
  881. WriteINIStr $INSTDIR\mysql\my.ini mysqld character-set-server utf8mb4
  882. WriteINIStr $INSTDIR\mysql\my.ini mysqld default-storage-engine INNODB
  883. WriteINIStr $INSTDIR\mysql\my.ini mysqld default_authentication_plugin mysql_native_password
  884. WriteINIStr $INSTDIR\mysql\my.ini mysqld local_infile ON
  885. WriteINIStr $INSTDIR\mysql\my.ini mysql default-character-set utf8mb4
  886. WriteINIStr $INSTDIR\mysql\my.ini mysql local_infile ON
  887. WriteINIStr $INSTDIR\mysql\my.ini client port 3307
  888. WriteINIStr $INSTDIR\mysql\my.ini client default-character-set utf8mb4
  889. Sleep 2000
  890. SetOutPath "$INSTDIR\mysql\bin"
  891. ReadRegStr $vc_flag HKLM "SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\X64" "Installed"
  892. ${IF} $vc_flag != "1"
  893. nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\VC_redist.x64.exe /install /quiet /norestart'
  894. ${EndIf}
  895. LogEx::Init "$INSTDIR\tools\install.txt"
  896. Sleep 2000
  897. nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\mysqld.exe --initialize-insecure --lower-case-table-names=1'
  898. Pop $0
  899. Pop $1
  900. LogEx::Write "mysqld-exitcode: $0,stdout:$1"
  901. Sleep 2000
  902. nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\mysqld.exe --install lasermysql'
  903. Pop $0
  904. Pop $1
  905. LogEx::Write "install lasermysql-exitcode: $0,stdout:$1"
  906. ; Pop $0
  907. ; Pop $1
  908. ; ${If} $0 = 0
  909. ; nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\mysqld.exe --install lasermysql'
  910. ; ${Else}
  911. ; ;MessageBox mb_ok "code=$0,mes=$1"
  912. ; Sleep 2000
  913. ; nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\mysqld.exe --initialize-insecure --lower-case-table-names=1'
  914. ; Sleep 2000
  915. ; nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\mysqld.exe --install lasermysql'
  916. ; ${EndIf}
  917. IfFileExists "$INSTDIR\USER_DATA\data\*.*" 0 static_not_found
  918. CopyFiles /SILENT $INSTDIR\USER_DATA\data\*.* $INSTDIR\mysql\data
  919. RMDir /r "$INSTDIR\USER_DATA\data\"
  920. Delete "$INSTDIR\mysql\sqlfile\fdkk_laser.sql"
  921. goto static_end_of
  922. static_not_found:
  923. goto static_end_of
  924. static_end_of:
  925. nsExec::ExecToStack '"cmd.exe" /c powercfg.exe /hibernate off '
  926. SimpleSC::StartService "lasermysql" "" 30
  927. SetOutPath "$INSTDIR\redis"
  928. nsExec::ExecToStack '"cmd.exe" /c redis-server.exe --service-install "$INSTDIR\redis\redis.windows.conf" --service-name laserredis --loglevel verbose'
  929. Pop $0
  930. Pop $1
  931. LogEx::Write "install redis-exitcode: $0,stdout:$1"
  932. SimpleSC::StartService "laserredis" "" 30
  933. nsExec::ExecToStack '"cmd.exe" /c sc config laserredis start=auto'
  934. SimpleSC::RestartService "laserredis" "" 30
  935. Sleep 2000
  936. SetOutPath "$INSTDIR\mongodb"
  937. ${StrRep} $0 '$INSTDIR\mongodb\db' '\' '\\'
  938. StrCpy $dbpath $0
  939. ${StrRep} $0 '$INSTDIR\mongodb\logs\mongo.log' '\' '\\'
  940. StrCpy $logpath $0
  941. ClearErrors
  942. FileOpen $0 $INSTDIR\mongodb\mongo.conf w
  943. IfErrors otherW
  944. FileWrite $0 'port=29031$\n'
  945. FileWrite $0 'dbpath=$dbpath$\n'
  946. FileWrite $0 'logpath=$logpath$\n'
  947. FileWrite $0 'logappend=true$\n'
  948. FileWrite $0 'maxConns=1000$\n'
  949. FileClose $0
  950. goto done
  951. otherW:
  952. ;nsExec::ExecToStack "$INSTDIR\tools\laserOtherTools.exe -m w -i $INSTDIR\mongodb"
  953. nsExec::ExecToStack '"$INSTDIR\tools\wirteMconf.bat" $INSTDIR\mongodb\ '
  954. goto done
  955. done:
  956. nsExec::ExecToStack '"cmd.exe" /c sc create lasermongodb binpath= "$INSTDIR\mongodb\bin\mongod.exe --config $INSTDIR\mongodb\mongo.conf --service" start= auto'
  957. Pop $0
  958. Pop $1
  959. LogEx::Write "install lasermongodb-exitcode: $0,stdout:$1"
  960. SimpleSC::StartService "lasermongodb" "" 30
  961. Sleep 2000
  962. ;nsExec::ExecToStack '"cmd.exe" /c sc failure lasermongodb reset= 43200 actions= restart/60000/restart/86400//86400'
  963. ;nsExec::ExecToStack '"cmd.exe" /c sc failure laserredis reset= 43200 actions= restart/60000/restart/86400//86400'
  964. ;nsExec::ExecToStack '"cmd.exe" /c sc failure lasermysql reset= 43200 actions= restart/60000/restart/86400//86400'
  965. ; IfFileExists "$INSTDIR\USER_DATA\pro\*.*" 0 pro_not_found
  966. ; CopyFiles /SILENT $INSTDIR\USER_DATA\pro\*.* $INSTDIR\4DKK_PROGRAM_DATA
  967. ; RMDir /r "$INSTDIR\USER_DATA\pro"
  968. ; goto pro_end_of
  969. ; pro_not_found:
  970. ; goto pro_end_of
  971. ; pro_end_of:
  972. Sleep 2000
  973. ;
  974. ${StrRep} $0 '$INSTDIR\4DKK_PROGRAM_DATA\' '\' '\\'
  975. StrCpy $buildModelPath $0
  976. ${StrRep} $0 '$INSTDIR\4DKK_PROGRAM_STATIC\' '\' '\\'
  977. StrCpy $profilePath $0
  978. ${StrRep} $0 '$INSTDIR\CGAII' '\' '\\'
  979. StrCpy $buildCallPath $0
  980. ${StrRep} $0 '$INSTDIR\bin\resources\static' '\' '\\'
  981. StrCpy $binPath $0
  982. ${StrRep} $0 '$INSTDIR\jdk1.8\bin\java.exe' '\' '\\'
  983. StrCpy $javaPath $0
  984. ${StrRep} $0 '$INSTDIR\iReal3D\iReal3D.exe' '\' '\\'
  985. StrCpy $IREAL_PATH $0
  986. ${StrRep} $0 '$INSTDIR\smart3D\smart3D.exe' '\' '\\'
  987. StrCpy $SMART3D_PATH $0
  988. nsJSON::Set /file $INSTDIR\bin\resources\static\setting.json
  989. nsJSON::Set /value `{}`
  990. nsJSON::Set `sceneConfig` /value `"config.json"`
  991. nsJSON::Set `sceheKey` /value `"id"`
  992. nsJSON::Set `sceneBundle` /value `"./build.zip"`
  993. nsJSON::Set `sceneBundleDir` /value `"capture"`
  994. nsJSON::Set `buildModelPath` /value `"$buildModelPath"`
  995. nsJSON::Set `javaPort` /value `9000`
  996. nsJSON::Set `v4JavaPort` /value `9101`
  997. nsJSON::Set `javaPath` /value `"$javaPath"`
  998. nsJSON::Set `profilePath` /value `"$profilePath"`
  999. nsJSON::Set `buildCallPath` /value `"$buildCallPath"`
  1000. nsJSON::Set `binPath` /value `"$binPath"`
  1001. nsJSON::Set `fuse` /value `${FUSE}`
  1002. nsJSON::Set `ver` /value `${VER}`
  1003. nsJSON::Set `version` /value `"${VERSION}"`
  1004. nsJSON::Set `isShowIreal` /value `${IS_SHOW_IREAL}`
  1005. nsJSON::Set `isShowSmart3D` /value `${IS_SHOW_SMART3D}`
  1006. nsJSON::Set `iReal` /value `"$IREAL_PATH"`
  1007. nsJSON::Set `smart3D` /value `"$SMART3D_PATH"`
  1008. nsJSON::Set `langList` /value `"${LANG_LIST}"`
  1009. nsJSON::Serialize /format /file $INSTDIR\bin\resources\static\setting.json
  1010. ;nsExec::ExecToStack "$INSTDIR\tools\laserOtherTools.exe -m l -i $INSTDIR"
  1011. nsExec::ExecToStack '"$INSTDIR\tools\service.bat" $INSTDIR '
  1012. nsExec::ExecToStack '"$INSTDIR\tools\update.bat" $INSTDIR '
  1013. ; FileOpen $0 $INSTDIR\bin\resources\static\4dmega.vmoptions w
  1014. ; IfErrors done
  1015. ; FileWrite $0 '-DBIN_PATH=$INSTDIR\bin\resources\static$\n'
  1016. ; FileWrite $0 '-DPROFILE_PATH=$INSTDIR\4DKK_PROGRAM_STATIC\$\n'
  1017. ; FileWrite $0 '-DBUILD_MODEL_PATH=$INSTDIR\4DKK_PROGRAM_DATA\$\n'
  1018. ; FileWrite $0 '-DBUILD_CALL_PATH=$INSTDIR\CGAII\$\n'
  1019. ; FileWrite $0 '-Dspring.profiles.active=standAloneProd$\n'
  1020. ; FileWrite $0 '-Dserver.port=9000$\n'
  1021. ; FileClose $0
  1022. ; done:
  1023. ;nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\tools\MonitorPid.exe install '
  1024. functionend
  1025. Function OnFinished
  1026. #MessageBox MB_YESNO|MB_ICONQUESTION "$(INSTALL_REBOOT)" IDNO +2
  1027. #Reboot
  1028. #Exec "$INSTDIR${EXE_NAME}"
  1029. # 调用PowerShell命令添加排除目录
  1030. nsExec::ExecToStack 'powershell -Command "Remove-MpPreference -ExclusionPath "$PLUGINSDIR""'
  1031. Call OnExitDUISetup
  1032. FunctionEnd
  1033. Function OnBtnSelectDir
  1034. nsNiuniuSkin::SelectInstallDirEx $hInstallDlg $(PLEASE_SELECT_INSTALLATION_PATH)
  1035. Pop $0
  1036. ${Unless} "$0" == ""
  1037. nsNiuniuSkin::SetControlAttribute $hInstallDlg "editDir" "text" $0
  1038. ${EndUnless}
  1039. FunctionEnd
  1040. Function StepHeightSizeAsc
  1041. ${ForEach} $R0 390 500 + 10
  1042. nsNiuniuSkin::SetWindowSize $hInstallDlg 480 $R0
  1043. Sleep 5
  1044. ${Next}
  1045. FunctionEnd
  1046. Function StepHeightSizeDsc
  1047. ${ForEach} $R0 480 390 - 10
  1048. nsNiuniuSkin::SetWindowSize $hInstallDlg 480 $R0
  1049. Sleep 5
  1050. ${Next}
  1051. FunctionEnd
  1052. Function OnBtnShowMore
  1053. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnShowMore" "enabled" "false"
  1054. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnHideMore" "enabled" "false"
  1055. nsNiuniuSkin::SetControlAttribute $hInstallDlg "moreconfiginfo" "visible" "true"
  1056. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnHideMore" "visible" "true"
  1057. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnShowMore" "visible" "false"
  1058. GetFunctionAddress $0 StepHeightSizeAsc
  1059. BgWorker::CallAndWait
  1060. nsNiuniuSkin::SetWindowSize $hInstallDlg 480 510
  1061. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnShowMore" "enabled" "true"
  1062. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnHideMore" "enabled" "true"
  1063. FunctionEnd
  1064. Function OnBtnHideMore
  1065. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnShowMore" "enabled" "false"
  1066. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnHideMore" "enabled" "false"
  1067. nsNiuniuSkin::SetControlAttribute $hInstallDlg "moreconfiginfo" "visible" "false"
  1068. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnHideMore" "visible" "false"
  1069. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnShowMore" "visible" "true"
  1070. GetFunctionAddress $0 StepHeightSizeDsc
  1071. BgWorker::CallAndWait
  1072. nsNiuniuSkin::SetWindowSize $hInstallDlg 480 390
  1073. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnShowMore" "enabled" "true"
  1074. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnHideMore" "enabled" "true"
  1075. FunctionEnd
  1076. Function OnBtnShowConfig
  1077. ;nsNiuniuSkin::ShowPageItem $hInstallDlg "wizardTab" ${INSTALL_PAGE_CONFIG}
  1078. nsNiuniuSkin::SetControlAttribute $hInstallDlg "licenseshow" "visible" "false"
  1079. FunctionEnd
  1080. Function OnBtnDirPre
  1081. StrCpy $R8 "$(CONFIRM_EXIT)"
  1082. StrCpy $R7 "0"
  1083. Call ShowMsgBox
  1084. ;nsNiuniuSkin::PrePage "wizardTab"
  1085. FunctionEnd
  1086. Function un.BtnDirPre
  1087. StrCpy $R8 "$(UNINSTALL)"
  1088. StrCpy $R7 "0"
  1089. Call un.ShowMsgBox
  1090. ;nsNiuniuSkin::PrePage "wizardTab"
  1091. FunctionEnd
  1092. Function un.ShowMsgBoxBackUps
  1093. nsNiuniuSkin::InitSkinSubPage "msgBox_backup.xml" "backupBtnOK" "gotouninstall"
  1094. Pop $hInstallSubDlg
  1095. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "lblMsg" "text" $(UNINSTALL_ERROR)
  1096. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "backupBtnOK" "text" $(I_KNOW)
  1097. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "lblTitle" "text" $(PROMPT)
  1098. nsNiuniuSkin::ShowSkinSubPage 0
  1099. FunctionEnd
  1100. Function un.ShowMsgBox
  1101. nsNiuniuSkin::InitSkinSubPage "msgBox.xml" "btnOK" "btnCancel,btnClose"
  1102. Pop $hInstallSubDlg
  1103. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "btnOK" "text" $(BTN_CONFIRM)
  1104. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "lblTitle" "text" $(PROMPT)
  1105. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "lblMsg" "text" "$R8"
  1106. ${If} "$R7" == "1"
  1107. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "hlCancel" "visible" "true"
  1108. ${EndIf}
  1109. nsNiuniuSkin::ShowSkinSubPage 0
  1110. FunctionEnd
  1111. Function un.ExitDUISetup
  1112. nsExec::ExecToStack 'ie4uinit.exe -ClearIconCache'
  1113. nsExec::ExecToStack 'ie4uinit.exe -show'
  1114. System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
  1115. ${RefreshShellIcons}
  1116. # 调用PowerShell命令添加排除目录
  1117. nsExec::ExecToStack 'powershell -Command "Remove-MpPreference -ExclusionPath "$PLUGINSDIR""'
  1118. nsExec::ExecToStack 'powershell -Command "Remove-MpPreference -ExclusionPath "$EXEDIR""'
  1119. nsNiuniuSkin::ExitDUISetup
  1120. FunctionEnd
  1121. Function un.OnBtnMin
  1122. SendMessage $hInstallDlg ${WM_SYSCOMMAND} 0xF020 0
  1123. FunctionEnd
  1124. Section "un.silentInstallSec" SEC02
  1125. #MessageBox MB_OK|MB_ICONINFORMATION "Test silent install. you can add your silent uninstall code here."
  1126. SectionEnd
  1127. Function un.onUninstall
  1128. nsProcess::_FindProcess "${EXE_NAME_EXT}"
  1129. Pop $R0
  1130. ${If} $R0 == 0
  1131. StrCpy $R8 "$(PRODUCT_NAME_LANG) $(TO_RUNNING)"
  1132. StrCpy $R7 "0"
  1133. Call un.ShowMsgBox
  1134. goto InstallAbort
  1135. ${EndIf}
  1136. nsNiuniuSkin::GetControlAttribute $hInstallDlg "chkbox_userdata" "selected"
  1137. Pop $0
  1138. StrCpy $sReserveData $0
  1139. ${If} $sReserveData == 1
  1140. nsNiuniuSkin::SetControlAttribute $hInstallDlg "un_progress_tip" "text" $(PREPARING_TO_UNINSTALL)
  1141. CreateDirectory $INSTDIR\USER_DATA
  1142. ; nsExec::ExecToStack "$INSTDIR\tools\laserOtherTools.exe -m v -i $INSTDIR"
  1143. ; Pop $0
  1144. SimpleSC::GetServiceStatus "lasermongodb"
  1145. Pop $0 ; 返回错误码,0 表示成功,非0 表示失败
  1146. Pop $1 ; 返回服务状态,状态值参考 Windows 服务状态代码
  1147. ${If} $0 == 0
  1148. ${If} $1 == 4 ; 服务状态值为 4 表示服务正在运行
  1149. Call un.onPassUninstall
  1150. ${Else}
  1151. RMDir /r "$INSTDIR\USER_DATA"
  1152. Call un.ShowMsgBoxBackUps
  1153. Pop $0
  1154. ${If} $0 == 0
  1155. Call un.onPassUninstall
  1156. ${EndIf}
  1157. ${If} $0 == 1
  1158. Call un.onNoPassUninstall
  1159. ${EndIf}
  1160. ${EndIf}
  1161. ${Else}
  1162. RMDir /r "$INSTDIR\USER_DATA"
  1163. Call un.ShowMsgBoxBackUps
  1164. Pop $0
  1165. ${If} $0 == 0
  1166. Call un.onPassUninstall
  1167. ${EndIf}
  1168. ${If} $0 == 1
  1169. Call un.onNoPassUninstall
  1170. ${EndIf}
  1171. ${EndIf}
  1172. ${Else}
  1173. Call un.onPassUninstall
  1174. ${EndIf}
  1175. InstallAbort:
  1176. FunctionEnd
  1177. Function un.onNoPassUninstall
  1178. nsNiuniuSkin::ExitDUISetup
  1179. FunctionEnd
  1180. Function un.onPassUninstall
  1181. ${If} $sReserveData == 1
  1182. CreateDirectory $INSTDIR\USER_DATA
  1183. ${EndIf}
  1184. Call un.initUninstallingPage
  1185. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnClose" "enabled" "false"
  1186. nsNiuniuSkin::ShowPageItem $hInstallDlg "wizardTab" ${INSTALL_PAGE_UNISTPROCESSING}
  1187. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrUnInstProgress" "min" "0"
  1188. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrUnInstProgress" "max" "100"
  1189. IntOp $UnInstallValue 0 + 1
  1190. nsNiuniuSkin::SetControlAttribute $hInstallDlg "un_progress_tip" "text" $(PREPARING_TO_UNINSTALL)
  1191. ; nsExec::ExecToStack "$INSTDIR\tools\laserOtherTools.exe -m b -i $INSTDIR "
  1192. ; BgWorker::CallAndWait
  1193. GetFunctionAddress $0 un.OnEnvDownInstall
  1194. BgWorker::CallAndWait
  1195. nsExec::ExecToStack 'cmd.exe /c powercfg.exe /hibernate on '
  1196. GetFunctionAddress $0 un.installService
  1197. BgWorker::CallAndWait
  1198. nsNiuniuSkin::SetControlAttribute $hInstallDlg "un_progress_tip" "text" $(UNINSTALLING)
  1199. Call un.DeleteShotcutAndInstallInfo
  1200. IntOp $UnInstallValue $UnInstallValue + 8
  1201. GetFunctionAddress $0 un.RemoveFiles
  1202. BgWorker::CallAndWait
  1203. FunctionEnd
  1204. Function un.RemoveFiles
  1205. ${Locate} "$INSTDIR" "/G=0 /M=*.*" "un.onDeleteFileFound"
  1206. StrCpy $InstallState "1"
  1207. ; 卸载成功后创建标记文件 0不用重启 1需要重启
  1208. WriteRegStr HKLM "Software\${PRODUCT_PATHNAME}" "reboot" 1
  1209. FileClose $0
  1210. ; 重启计算机
  1211. ; 创建任务计划程序命令
  1212. nsExec::ExecToStack 'schtasks /create /tn "DeleteInstallFlagTask" /tr "cmd.exe /C reg add "HKLM\SOFTWARE\4DMega_PC" /v reboot /t REG_SZ /d 2 /f " /sc onstart /ru System /rl HIGHEST /F'
  1213. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnClose" "enabled" "true"
  1214. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrUnInstProgress" "value" "100"
  1215. Call un.initUninstallFinishPage
  1216. nsNiuniuSkin::ShowPageItem $hInstallDlg "wizardTab" ${INSTALL_PAGE_UNISTFINISH}
  1217. FunctionEnd
  1218. Function un.onDeleteFileFound
  1219. ; $R9 "path\name"
  1220. ; $R8 "path"
  1221. ; $R7 "name"
  1222. ; $R6 "size" ($R6 = "" if directory, $R6 = "0" if file with /S=)
  1223. ; MessageBox MB_OK "R9--------$R9"
  1224. ; MessageBox MB_OK "R8--------$R8"
  1225. ; MessageBox MB_OK "R7--------$R7"
  1226. ;不用保留场景
  1227. ${If} $sReserveData == 0
  1228. Delete "$R9"
  1229. RMDir /r "$R9"
  1230. RMDir "$R9"
  1231. ${EndIf}
  1232. ;保留场景
  1233. ${If} $sReserveData == 1
  1234. ${If} $R7 != "install.flag"
  1235. RMDir /r "$R8\bin"
  1236. RMDir /r "$R8\CGAII"
  1237. RMDir /r "$R8\mongodb"
  1238. RMDir /r "$R8\mysql"
  1239. RMDir /r "$R8\redis"
  1240. RMDir /r "$R8\jdk1.8"
  1241. ; RMDir /r "$R8\4DKK_PROGRAM_STATIC"
  1242. ; RMDir /r "$R8\4DKK_PROGRAM_DATA"
  1243. RMDir /r "$R8\tools"
  1244. Delete "$R8\uninst.exe"
  1245. ${EndIf}
  1246. ${EndIf}
  1247. IntOp $UnInstallValue $UnInstallValue + 2
  1248. ${If} $UnInstallValue > 100
  1249. IntOp $UnInstallValue 100 + 0
  1250. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrUnInstProgress" "value" "100"
  1251. ${Else}
  1252. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrUnInstProgress" "value" "$UnInstallValue"
  1253. nsNiuniuSkin::SetControlAttribute $hInstallDlg "un_progress_pos" "text" "$UnInstallValue%"
  1254. #Sleep 100
  1255. ${EndIf}
  1256. undelete:
  1257. Push "LocateNext"
  1258. FunctionEnd
  1259. #
  1260. # 以 Unicode 字符串的方式进行判断 (与 NSIS 是 ANSI/Unicode 无关)
  1261. # 但建议 Unicode 版本优先使用此函数。
  1262. #
  1263. Function PathIsDBCS_W
  1264. Exch $R0
  1265. Push $R1
  1266. Push $R2
  1267. Push $R3
  1268. System::Call "*(&w${NSIS_MAX_STRLEN}R0)p.R1"
  1269. StrCpy $R0 0
  1270. StrCpy $R2 $R1
  1271. lbl_loop:
  1272. # Unicode 版取 2 个字节长度的字符,字符串遇到 0 字符表示结束了。
  1273. System::Call "*$R2(&i2.R3)"
  1274. IntCmp $R3 0 lbl_done
  1275. # Unicode 字符直接判断字符值,大于 128 的我们就视为非英文字符。
  1276. IntCmp $R3 128 0 lbl_skip
  1277. IntOp $R0 $R0 !
  1278. Goto lbl_done
  1279. lbl_skip:
  1280. # 如果用 NSIS 3.x 这里可以用 IntPtrOp 代替。
  1281. IntOp $R2 $R2 + 2
  1282. Goto lbl_loop
  1283. lbl_done:
  1284. System::Free $R1
  1285. Pop $R3
  1286. Pop $R2
  1287. Pop $R1
  1288. Exch $R0
  1289. FunctionEnd
  1290. #
  1291. # 以 ANSI 字符串的方式进行判断 (与 NSIS 是 ANSI/Unicode 无关)
  1292. # 但建议 ANSI 版本优先使用此函数。
  1293. #
  1294. Function PathIsDBCS_A
  1295. Exch $R0
  1296. Push $R1
  1297. Push $R2
  1298. Push $R3
  1299. Push $R4
  1300. System::Call "*(&m${NSIS_MAX_STRLEN}R0)p.R1"
  1301. StrCpy $R0 0
  1302. StrCpy $R2 $R1
  1303. lbl_loop:
  1304. # ANSI 版取 1 个字节长度的字符,字符串遇到 0 字符表示结束了。
  1305. System::Call "*$R2(&i1.R3)"
  1306. IntCmp $R3 0 lbl_done
  1307. # ANSI 字符用 IsDBCSLeadByte 判断是否双字节字符的前导字节。
  1308. System::Call "kernel32::IsDBCSLeadByte(iR3)i.R4"
  1309. IntCmp $R4 0 lbl_skip
  1310. IntOp $R0 $R0 !
  1311. Goto lbl_done
  1312. lbl_skip:
  1313. # 用 CharNextA 得到下一个字符的地址 (可正确处理双字节字符)。
  1314. System::Call "user32::CharNextA(pR2)p.R2"
  1315. Goto lbl_loop
  1316. lbl_done:
  1317. Pop $R4
  1318. Pop $R3
  1319. Pop $R2
  1320. Pop $R1
  1321. Exch $R0
  1322. FunctionEnd
  1323. #
  1324. # 当选择的安装路径变更时,路径为空或包含双字节字符 (不限于简体中文),都不允许继续。
  1325. # 路径为空时,NSIS 会自行判断。
  1326. #
  1327. # 此示例未判断是否包含空格。如有需要,请与示例一配合使用。
  1328. #
  1329. Function onVerifyInstDir
  1330. # 检查安装路径是否包含双字节字符 (不限于简体中文)。
  1331. StrCpy $0 $INSTDIR
  1332. StrLen $1 $0
  1333. # 这里也可以换成 CheckEnglishPath 以测试效果。
  1334. ${If} $1 == 0
  1335. Push 2
  1336. ${Else}
  1337. Push $INSTDIR
  1338. Call PathIsDBCS_A
  1339. Pop $R0
  1340. Push $R0
  1341. ${endif}
  1342. lbl_done:
  1343. FunctionEnd
  1344. Function CheckEnglishPath
  1345. Exch $0 ; 保存返回值的变量
  1346. Exch ; 将字符串参数放在栈顶
  1347. Push $1
  1348. Push $2
  1349. Push $3
  1350. StrLen $1 $0 ; 计算字符串长度
  1351. loop:
  1352. StrCpy $2 $1 ; 复制当前长度
  1353. IntOp $1 $1 - 1 ; 长度减1
  1354. StrCpy $3 $0 1 $2 ; 获取当前字符
  1355. ${If} $3 == " " ; 如果字符是空格
  1356. Goto notEnglish ; 跳转到不是英文路径的逻辑
  1357. ${EndIf}
  1358. ${If} $1 > 0 ; 如果还有字符未检查
  1359. Goto loop ; 继续循环
  1360. ${EndIf}
  1361. ; 路径是全英文的
  1362. Pop $3
  1363. Pop $2
  1364. Pop $1
  1365. StrCpy $0 0
  1366. Exch $0
  1367. notEnglish:
  1368. ; 路径不是全英文的
  1369. Pop $3
  1370. Pop $2
  1371. Pop $1
  1372. StrCpy $0 1
  1373. Exch $0
  1374. FunctionEnd
  1375. Function onVerifySpecialInstDir
  1376. # 检查安装路径是否包含双字节字符 (不限于简体中文)。
  1377. StrCpy $0 $INSTDIR
  1378. StrLen $1 $0
  1379. # 这里也可以换成 PathIsDBCS_A 以测试效果。
  1380. ${If} $1 == 0
  1381. Push 2
  1382. ${Else}
  1383. Push $INSTDIR
  1384. Call CheckSpecialCharacters
  1385. Pop $0 ; 获取返回结果
  1386. Push $R0
  1387. ${endif}
  1388. FunctionEnd
  1389. Function CheckSpecialCharacters
  1390. Exch $0 ; 保存返回值的变量
  1391. Exch ; 将字符串参数放在栈顶
  1392. StrCpy $1 "!@#¥%……&*()!@#$%^&*()<>_+{}[];'?.,~`" ; 特殊字符
  1393. StrCpy $2 0 ; 特殊字符字符串索引
  1394. StrCpy $3 0 ; 字符串索引
  1395. StrLen $4 $0 ; 特殊字符字符串长度
  1396. loop:
  1397. StrCpy $5 $1 1 $2 ; 从特殊字符字符串中获取一个字符
  1398. StrCpy $6 $0 1 $3 ; 从需要检查的字符串中获取一个字符
  1399. StrCmp $5 "" done ; 如果特殊字符字符串已经检查完,跳转到 done
  1400. StrCmp $6 "" next ; 如果需要检查的字符串已经检查完,跳转到 next
  1401. StrCmp $5 $6 found ; 如果找到特殊字符,跳转到 found
  1402. IntOp $3 $3 + 1 ; 否则,增加需要检查的字符串的索引
  1403. Goto loop
  1404. next:
  1405. IntOp $2 $2 + 1 ; 增加特殊字符字符串的索引
  1406. StrCpy $3 0 ; 重置需要检查的字符串的索引
  1407. Goto loop
  1408. found:
  1409. StrCpy $0 "1"
  1410. Goto End
  1411. done:
  1412. StrCpy $0 "0"
  1413. end:
  1414. Exch $0 ; 将返回值出栈
  1415. FunctionEnd
  1416. Function isEmptyDir
  1417. # Stack -> # Stack: <directory>
  1418. Exch $0 # Stack: $0
  1419. Push $1 # Stack: $1, $0
  1420. FindFirst $0 $1 "$0\*.*"
  1421. strcmp $1 "." 0 _notempty
  1422. FindNext $0 $1
  1423. strcmp $1 ".." 0 _notempty
  1424. ClearErrors
  1425. FindNext $0 $1
  1426. IfErrors 0 _notempty
  1427. FindClose $0
  1428. Pop $1 # Stack: $0
  1429. StrCpy $0 1
  1430. Exch $0 # Stack: 1 (true)
  1431. goto _end
  1432. _notempty:
  1433. FindClose $0
  1434. ClearErrors
  1435. Pop $1 # Stack: $0
  1436. StrCpy $0 0
  1437. Exch $0 # Stack: 0 (false)
  1438. _end:
  1439. FunctionEnd
  1440. Function un.isEmptyDir
  1441. # Stack -> # Stack: <directory>
  1442. Exch $0 # Stack: $0
  1443. Push $1 # Stack: $1, $0
  1444. FindFirst $0 $1 "$0\*.*"
  1445. strcmp $1 "." 0 _notempty
  1446. FindNext $0 $1
  1447. strcmp $1 ".." 0 _notempty
  1448. ClearErrors
  1449. FindNext $0 $1
  1450. IfErrors 0 _notempty
  1451. FindClose $0
  1452. Pop $1 # Stack: $0
  1453. StrCpy $0 1
  1454. Exch $0 # Stack: 1 (true)
  1455. goto _end
  1456. _notempty:
  1457. FindClose $0
  1458. ClearErrors
  1459. Pop $1 # Stack: $0
  1460. StrCpy $0 0
  1461. Exch $0 # Stack: 0 (false)
  1462. _end:
  1463. FunctionEnd
  1464. Function initRegPage
  1465. nsNiuniuSkin::SetControlAttribute $hInstallDlg "reg_title" "bkimage" $(REG_TITLE)
  1466. nsNiuniuSkin::SetControlAttribute $hInstallDlg "install_info" "text" $(INSTALL_INFO)
  1467. nsNiuniuSkin::SetControlAttribute $hInstallDlg "machineCode" "text" $(MACHINE_CODE)
  1468. nsNiuniuSkin::SetControlAttribute $hInstallDlg "reg_machine_info" "text" $(REG_MACHINE_INFO)
  1469. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnCopyMachineinfo" "text" $(BTN_COPY_MACHINEINFO)
  1470. nsNiuniuSkin::SetControlAttribute $hInstallDlg "installKey" "text" $(INSTALL_KEY)
  1471. nsNiuniuSkin::SetControlAttribute $hInstallDlg "regPrompt" "text" $(REG_PROMPT)
  1472. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnRegConfirm" "text" $(BTN_REG_CONFIRM)
  1473. FunctionEnd
  1474. Function initConfigPage
  1475. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configPageTitle" "bkimage" $(CONFIG_PAGE_TITLE)
  1476. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPath" "text" $(CONFIG_INSTALL_PATH)
  1477. nsNiuniuSkin::SetControlAttribute $hInstallDlg "chkAgree" "text" $(CONFIG_CHK_AGREE)
  1478. ${If} $LANGUAGE == '1033'
  1479. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPath" "width" 115
  1480. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPathTip" "width" 310
  1481. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPathTip" "font" 11
  1482. ${ElseIf} $LANGUAGE == '1041'
  1483. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPath" "width" 100
  1484. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPathTip" "font" 5
  1485. nsNiuniuSkin::SetControlAttribute $hInstallDlg "chkAgree" "width" 190
  1486. ${ElseIf} $LANGUAGE == '1042'
  1487. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPath" "width" 70
  1488. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPathTip" "font" 5
  1489. ${ElseIf} $LANGUAGE == '2052'
  1490. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPath" "width" 60
  1491. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPathTip" "font" 5
  1492. ${EndIf}
  1493. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPathTip" "text" $(CONFIG_INSTALL_PATH_TIP)
  1494. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configUseSpace" "text" $(CONFIG_USE_SPACE)
  1495. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnAgreement" "text" $(CONFIG_BTN_AGREEMENT)
  1496. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "text" $(CONFIG_BTN_INSTALL)
  1497. FunctionEnd
  1498. Function initLicensePage
  1499. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnAgree" "text" $(LICENSE_BTN_AGREE)
  1500. FunctionEnd
  1501. Function initInstallingPage
  1502. nsNiuniuSkin::SetControlAttribute $hInstallDlg "InstallingTitle" "bkimage" $(INSTALLING_TITLE)
  1503. FunctionEnd
  1504. Function initFinishPage
  1505. nsNiuniuSkin::SetControlAttribute $hInstallDlg "FinishPageTitle" "bkimage" $(FINISH_PAGE_TITLE)
  1506. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnRun" "text" $(BTN_RUN)
  1507. FunctionEnd
  1508. Function un.initUnInstallPage
  1509. nsNiuniuSkin::SetControlAttribute $hInstallDlg "unInstallTitle" "bkimage" $(UN_INSTALL_TITLE)
  1510. nsNiuniuSkin::SetControlAttribute $hInstallDlg "unInstallPrompt" "text" $(UN_INSTALL_PROMPT)
  1511. nsNiuniuSkin::SetControlAttribute $hInstallDlg "chkbox_userdata" "text" $(UN_INSTALL_CHKBOX_USERDATA)
  1512. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnUnInstall" "text" $(BTN_CONFIRM)
  1513. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnUnClose" "text" $(BTN_CANCEL)
  1514. FunctionEnd
  1515. Function un.initUninstallingPage
  1516. nsNiuniuSkin::SetControlAttribute $hInstallDlg "unInstallingTitle" "bkimage" $(UN_INSTALL_TITLE)
  1517. FunctionEnd
  1518. Function un.initUninstallFinishPage
  1519. nsNiuniuSkin::SetControlAttribute $hInstallDlg "unInstallFinishTitle" "bkimage" $(UN_INSTALL_TITLE)
  1520. nsNiuniuSkin::SetControlAttribute $hInstallDlg "unInstallFinishPrompt" "text" $(UN_INSTALL_FINISH_PROMPT)
  1521. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnUninstalled" "text" $(BTN_UNINSTALLED)
  1522. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnUninstalledReboot" "text" $(BTN_UNINSTALLED_REBOOT)
  1523. FunctionEnd