ui_laser_setup.nsh 125 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892
  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 "四维看看本地版", 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 "四维看看本地版", 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 "四维看看本地版", i ${MB_OK})i .r1'
  176. Quit
  177. ${EndIf}
  178. ${If} $R0 == "1"
  179. System::Call 'USER32::MessageBox(i $hwndparent, t "版本 $OLD_VER 已安装在计算机中。如需重新安装,请卸载已有的安装", t "四维看看本地版", 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 "四维看看本地版", 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 "四维看看本地版", 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::RemoveService "lasermysql"
  665. nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\mysqld.exe --install lasermysql --defaults-file="$INSTDIR\mysql\my.ini"'
  666. SimpleSC::StopService "laserredis" 0 30
  667. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(REMOVE_FILES)
  668. RMDir /r "$INSTDIR\bin"
  669. BgWorker::CallAndWait
  670. RMDir /r "$INSTDIR\CGAII"
  671. Sleep 2000
  672. BgWorker::CallAndWait
  673. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(UPDATING)
  674. ${EndIf}
  675. GetFunctionAddress $0 ExtractFunc
  676. BgWorker::CallAndWait
  677. nsNiuniuSkin::GetControlAttribute $hInstallDlg "chkShotcut" "selected"
  678. #Pop $R0
  679. # ${If} $R0 == "1"
  680. # SetShellVarContext all
  681. # CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\${EXE_NAME}"
  682. # SetShellVarContext current
  683. # ${EndIf}
  684. SetOutPath "$INSTDIR\bin"
  685. SetShellVarContext all
  686. Delete "$DESKTOP\四维看看本地版.lnk"
  687. Delete "$DESKTOP\4DKanKan.lnk"
  688. CreateShortCut "$DESKTOP\$(PRODUCT_NAME_LANG_LNK).lnk" "$INSTDIR\${EXE_NAME}"
  689. SetShellVarContext current
  690. Call CreateAppShortcut
  691. Call CreateUninstall
  692. ${If} $update == "1"
  693. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(INITIALIZING)
  694. GetFunctionAddress $0 OnEnvInstall
  695. BgWorker::CallAndWait
  696. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(INITIALIZING_SERVICE)
  697. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_pos" "text" ""
  698. GetFunctionAddress $0 installService
  699. BgWorker::CallAndWait
  700. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(INITIALIZING_SERVICE_DONE)
  701. ${Else}
  702. SimpleSC::StartService "lasermongodb" "" 30
  703. SimpleSC::StartService "lasermysql" "" 30
  704. SimpleSC::StartService "laserredis" "" 30
  705. ;nsExec::ExecToStack '"cmd.exe" /c sc failure lasermongodb reset= 43200 actions= restart/60000/restart/86400//86400'
  706. ;nsExec::ExecToStack '"cmd.exe" /c sc failure laserredis reset= 43200 actions= restart/60000/restart/86400//86400'
  707. ;nsExec::ExecToStack '"cmd.exe" /c sc failure lasermysql reset= 43200 actions= restart/60000/restart/86400//86400'
  708. Sleep 2000
  709. ;
  710. ${StrRep} $0 '$INSTDIR\4DKK_PROGRAM_DATA\' '\' '\\'
  711. StrCpy $buildModelPath $0
  712. ${StrRep} $0 '$INSTDIR\4DKK_PROGRAM_STATIC\' '\' '\\'
  713. StrCpy $profilePath $0
  714. ${StrRep} $0 '$INSTDIR\CGAII' '\' '\\'
  715. StrCpy $buildCallPath $0
  716. ${StrRep} $0 '$INSTDIR\bin\resources\static' '\' '\\'
  717. StrCpy $binPath $0
  718. ${StrRep} $0 '$INSTDIR\jdk1.8\bin\java.exe' '\' '\\'
  719. StrCpy $javaPath $0
  720. ${StrRep} $0 '$INSTDIR\iReal3D\iReal3D\iReal3D.exe' '\' '\\'
  721. StrCpy $IREAL_PATH $0
  722. ${StrRep} $0 '$INSTDIR\smart3D\smart3D.exe' '\' '\\'
  723. StrCpy $SMART3D_PATH $0
  724. nsJSON::Set /file $INSTDIR\bin\resources\static\setting.json
  725. nsJSON::Set /value `{}`
  726. nsJSON::Set `sceneConfig` /value `"config.json"`
  727. nsJSON::Set `sceheKey` /value `"id"`
  728. nsJSON::Set `sceneBundle` /value `"./build.zip"`
  729. nsJSON::Set `sceneBundleDir` /value `"capture"`
  730. nsJSON::Set `buildModelPath` /value `"$buildModelPath"`
  731. nsJSON::Set `javaPort` /value `9000`
  732. nsJSON::Set `v4JavaPort` /value `9101`
  733. nsJSON::Set `javaPath` /value `"$javaPath"`
  734. nsJSON::Set `profilePath` /value `"$profilePath"`
  735. nsJSON::Set `buildCallPath` /value `"$buildCallPath"`
  736. nsJSON::Set `binPath` /value `"$binPath"`
  737. nsJSON::Set `fuse` /value `${FUSE}`
  738. nsJSON::Set `ver` /value `${VER}`
  739. nsJSON::Set `version` /value `"${VERSION}"`
  740. nsJSON::Set `isShowIreal` /value `${IS_SHOW_IREAL}`
  741. nsJSON::Set `isShowSmart3D` /value `${IS_SHOW_SMART3D}`
  742. nsJSON::Set `iReal` /value `"$IREAL_PATH"`
  743. nsJSON::Set `smart3D` /value `"$SMART3D_PATH"`
  744. nsJSON::Set `langList` /value `"${LANG_LIST}"`
  745. nsJSON::Serialize /format /file $INSTDIR\bin\resources\static\setting.json
  746. nsExec::ExecToStack '"$INSTDIR\tools\update.bat" $INSTDIR '
  747. ;;处理旧版本数据
  748. ${IF} $OLD_VER != ""
  749. ${VersionCompare} $OLD_VER "1.1.8.6" $R0
  750. ;;MessageBox mb_ok "$R0-------比对"
  751. ${If} $R0 == "2"
  752. LogEx::Init "$INSTDIR\tools\update.txt"
  753. nsExec::ExecToStack '"$INSTDIR\mongodb\update\update.bat" '
  754. Pop $0
  755. Pop $1
  756. LogEx::Write "mongo-update-exitcode: $0,stdout:$1"
  757. ${EndIf}
  758. ${EndIf}
  759. ;nsExec::ExecToStack "$INSTDIR\tools\laserOtherTools.exe -m u -i $INSTDIR"
  760. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_tip" "text" $(UPDATING_DONE)
  761. ${EndIf}
  762. StrCpy $InstallState "1"
  763. Call initFinishPage
  764. nsNiuniuSkin::ShowPageItem $hInstallDlg "wizardTab" ${INSTALL_PAGE_FINISH}
  765. #Call OnFinished
  766. ${If} $update == "0"
  767. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnRun" "text" $(UPDATING_DONE)
  768. ${EndIf}
  769. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnClose" "enabled" "true"
  770. ;完成安装删除计划任务
  771. nsExec::ExecToStack 'ie4uinit.exe -ClearIconCache'
  772. nsExec::ExecToStack 'ie4uinit.exe -show'
  773. System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
  774. ${RefreshShellIcons}
  775. WriteRegStr HKLM "Software\${PRODUCT_PATHNAME}" "language" $LANGUAGE
  776. InstallAbort:
  777. FunctionEnd
  778. Function ExtractCallback
  779. Pop $1
  780. Pop $2
  781. System::Int64Op $1 * 100
  782. Pop $3
  783. System::Int64Op $3 / $2
  784. Pop $0
  785. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrProgress" "value" "$0"
  786. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_pos" "text" "$0%"
  787. ${If} $1 == $2
  788. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrProgress" "value" "100"
  789. nsNiuniuSkin::SetControlAttribute $hInstallDlg "progress_pos" "text" "100%"
  790. ${EndIf}
  791. FunctionEnd
  792. Function OnSysCommandCloseEvent
  793. Call OnExitDUISetup
  794. FunctionEnd
  795. Function OnExitDUISetup
  796. ${If} $InstallState == "0"
  797. StrCpy $R8 "$(CONFIRM_EXIT)"
  798. StrCpy $R7 "1"
  799. Call ShowMsgBox
  800. pop $0
  801. ${If} $0 == 0
  802. goto endfun
  803. ${EndIf}
  804. ${EndIf}
  805. nsNiuniuSkin::ExitDUISetup
  806. endfun:
  807. FunctionEnd
  808. Function OnBtnMin
  809. SendMessage $hInstallDlg ${WM_SYSCOMMAND} 0xF020 0
  810. FunctionEnd
  811. Function OnBtnCancel
  812. nsNiuniuSkin::ExitDUISetup
  813. FunctionEnd
  814. Function OnEnvInstall
  815. EnVar::SetHKLM
  816. EnVar::AddValue FDMGEA_HOME "$INSTDIR"
  817. ;EnVar::SetHKLM
  818. ;EnVar::AddValue JAVA_HOME "$INSTDIR\jdk1.8"
  819. EnVar::SetHKLM
  820. EnVar::AddValue MYSQL_HOME "$INSTDIR\mysql"
  821. EnVar::SetHKLM
  822. EnVar::AddValue REDIS_HOME "$INSTDIR\redis"
  823. EnVar::SetHKLM
  824. EnVar::AddValue 4DKK_HOME "$INSTDIR\CGAII;$INSTDIR\CGAII\3dtile"
  825. EnVar::SetHKLM
  826. EnVar::AddValue MONGODB_HOME "$INSTDIR\mongodb"
  827. ;EnVar::SetHKLM
  828. ;EnVar::AddValue CLASS_PATH ".;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar"
  829. EnVar::SetHKLM
  830. ;EnVar::AddValue "Path" "$INSTDIR\jdk1.8\bin;$INSTDIR\mysql\bin;$INSTDIR\mongodb\bin;$INSTDIR\redis;$INSTDIR\CGAII;$INSTDIR\CGAII\lib;"
  831. EnVar::AddValue "Path" "$INSTDIR\mysql\bin;$INSTDIR\mongodb\bin;$INSTDIR\redis;$INSTDIR\CGAII;$INSTDIR\CGAII\lib;$INSTDIR\CGAII\3dtile"
  832. SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
  833. ;nsExec::ExecToStack '"$INSTDIR\tools\env_install.bat" $INSTDIR '
  834. FunctionEnd
  835. Function un.OnEnvDownInstall
  836. EnVar::SetHKLM
  837. EnVar::Delete "FDMGEA_HOME" "$INSTDIR"
  838. ;EnVar::Delete "JAVA_HOME" "$INSTDIR\jdk1.8"
  839. EnVar::Delete "MYSQL_HOME" "$INSTDIR\mysql"
  840. EnVar::Delete "REDIS_HOME" "$INSTDIR\redis"
  841. EnVar::Delete "4DKK_HOME" "$INSTDIR\CGAII"
  842. EnVar::Delete "4DKK_HOME" "$INSTDIR\CGAII\3dtile"
  843. EnVar::Delete "MONGODB_HOME" "$INSTDIR\mongodb"
  844. ;EnVar::Delete "CLASS_PATH" "%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar"
  845. ;EnVar::DeleteValue "PATH" "%JAVA_HOME%\bin"
  846. EnVar::DeleteValue "PATH" "$INSTDIR\mysql\bin"
  847. EnVar::DeleteValue "PATH" "$INSTDIR\mongodb\bin"
  848. EnVar::DeleteValue "PATH" "$INSTDIR\redis"
  849. EnVar::DeleteValue "PATH" "$INSTDIR\CGAII"
  850. EnVar::DeleteValue "PATH" "$INSTDIR\CGAII\lib"
  851. EnVar::DeleteValue "PATH" "$INSTDIR\CGAII\3dtile"
  852. ;nsExec::ExecToStack '"$INSTDIR\tools\uninstall.bat" $INSTDIR '
  853. FunctionEnd
  854. Function un.installService
  855. nsExec::ExecToStack '"$INSTDIR\tools\unservice.bat" $INSTDIR '
  856. SimpleSC::ExistsService "lasermongodb"
  857. Pop $0
  858. ${If} $0 == 0
  859. SimpleSC::StopService "lasermongodb" 0 30
  860. SimpleSC::RemoveService "lasermongodb"
  861. ${EndIf}
  862. SimpleSC::ExistsService "lasermysql"
  863. Pop $0
  864. ${If} $0 == 0
  865. SimpleSC::StopService "lasermysql" 0 30
  866. SimpleSC::RemoveService "lasermysql"
  867. ${EndIf}
  868. SimpleSC::ExistsService "laserredis"
  869. Pop $0
  870. ${If} $0 == 0
  871. SimpleSC::StopService "laserredis" 0 30
  872. SimpleSC::RemoveService "laserredis"
  873. ${EndIf}
  874. SimpleSC::ExistsService "checkLaserProcess"
  875. Pop $0
  876. ${If} $0 == 0
  877. SimpleSC::StopService "checkLaserProcess" 0 30
  878. SimpleSC::RemoveService "checkLaserProcess"
  879. ${EndIf}
  880. FunctionEnd
  881. Function installService
  882. ${StrRep} $0 '$INSTDIR\mysql' '\' '\\'
  883. StrCpy $basedir $0
  884. ${StrRep} $0 '$INSTDIR\mysql\data' '\' '\\'
  885. StrCpy $datadir $0
  886. ${StrRep} $0 '$INSTDIR\mysql\logs.log' '\' '\\'
  887. StrCpy $logError $0
  888. WriteINIStr $INSTDIR\mysql\my.ini mysqld port 3307
  889. WriteINIStr $INSTDIR\mysql\my.ini mysqld basedir $basedir
  890. WriteINIStr $INSTDIR\mysql\my.ini mysqld datadir $datadir
  891. WriteINIStr $INSTDIR\mysql\my.ini mysqld log-error $logError
  892. WriteINIStr $INSTDIR\mysql\my.ini mysqld max_connections 1000
  893. WriteINIStr $INSTDIR\mysql\my.ini mysqld max_connect_errors 10
  894. WriteINIStr $INSTDIR\mysql\my.ini mysqld character-set-server utf8mb4
  895. WriteINIStr $INSTDIR\mysql\my.ini mysqld default-storage-engine INNODB
  896. WriteINIStr $INSTDIR\mysql\my.ini mysqld default_authentication_plugin mysql_native_password
  897. WriteINIStr $INSTDIR\mysql\my.ini mysqld local_infile ON
  898. WriteINIStr $INSTDIR\mysql\my.ini mysql default-character-set utf8mb4
  899. WriteINIStr $INSTDIR\mysql\my.ini mysql local_infile ON
  900. WriteINIStr $INSTDIR\mysql\my.ini client port 3307
  901. WriteINIStr $INSTDIR\mysql\my.ini client default-character-set utf8mb4
  902. Sleep 2000
  903. SetOutPath "$INSTDIR\mysql\bin"
  904. ReadRegStr $vc_flag HKLM "SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\X64" "Installed"
  905. ${IF} $vc_flag != "1"
  906. nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\VC_redist.x64.exe /install /quiet /norestart'
  907. ${EndIf}
  908. LogEx::Init "$INSTDIR\tools\install.txt"
  909. Sleep 2000
  910. nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\mysqld.exe --initialize-insecure --lower-case-table-names=1'
  911. Pop $0
  912. Pop $1
  913. LogEx::Write "mysqld-exitcode: $0,stdout:$1"
  914. Sleep 2000
  915. nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\mysqld.exe --install lasermysql --defaults-file="$INSTDIR\mysql\my.ini"'
  916. Pop $0
  917. Pop $1
  918. LogEx::Write "install lasermysql-exitcode: $0,stdout:$1"
  919. ; Pop $0
  920. ; Pop $1
  921. ; ${If} $0 = 0
  922. ; nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\mysqld.exe --install lasermysql'
  923. ; ${Else}
  924. ; ;MessageBox mb_ok "code=$0,mes=$1"
  925. ; Sleep 2000
  926. ; nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\mysqld.exe --initialize-insecure --lower-case-table-names=1'
  927. ; Sleep 2000
  928. ; nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\mysql\bin\mysqld.exe --install lasermysql --defaults-file="$INSTDIR\mysql\my.ini"'
  929. ; ${EndIf}
  930. IfFileExists "$INSTDIR\USER_DATA\data\*.*" 0 static_not_found
  931. CopyFiles /SILENT $INSTDIR\USER_DATA\data\*.* $INSTDIR\mysql\data
  932. RMDir /r "$INSTDIR\USER_DATA\data\"
  933. Delete "$INSTDIR\mysql\sqlfile\fdkk_laser.sql"
  934. goto static_end_of
  935. static_not_found:
  936. goto static_end_of
  937. static_end_of:
  938. nsExec::ExecToStack '"cmd.exe" /c powercfg.exe /hibernate off '
  939. SimpleSC::StartService "lasermysql" "" 30
  940. SetOutPath "$INSTDIR\redis"
  941. nsExec::ExecToStack '"cmd.exe" /c redis-server.exe --service-install "$INSTDIR\redis\redis.windows.conf" --service-name laserredis --loglevel verbose'
  942. Pop $0
  943. Pop $1
  944. LogEx::Write "install redis-exitcode: $0,stdout:$1"
  945. SimpleSC::StartService "laserredis" "" 30
  946. nsExec::ExecToStack '"cmd.exe" /c sc config laserredis start=auto'
  947. SimpleSC::RestartService "laserredis" "" 30
  948. Sleep 2000
  949. SetOutPath "$INSTDIR\mongodb"
  950. ${StrRep} $0 '$INSTDIR\mongodb\db' '\' '\\'
  951. StrCpy $dbpath $0
  952. ${StrRep} $0 '$INSTDIR\mongodb\logs\mongo.log' '\' '\\'
  953. StrCpy $logpath $0
  954. ClearErrors
  955. FileOpen $0 $INSTDIR\mongodb\mongo.conf w
  956. IfErrors otherW
  957. FileWrite $0 'port=29031$\n'
  958. FileWrite $0 'dbpath=$dbpath$\n'
  959. FileWrite $0 'logpath=$logpath$\n'
  960. FileWrite $0 'logappend=true$\n'
  961. FileWrite $0 'maxConns=1000$\n'
  962. FileClose $0
  963. goto done
  964. otherW:
  965. ;nsExec::ExecToStack "$INSTDIR\tools\laserOtherTools.exe -m w -i $INSTDIR\mongodb"
  966. nsExec::ExecToStack '"$INSTDIR\tools\wirteMconf.bat" $INSTDIR\mongodb\ '
  967. goto done
  968. done:
  969. nsExec::ExecToStack '"cmd.exe" /c sc create lasermongodb binpath= "$INSTDIR\mongodb\bin\mongod.exe --config $INSTDIR\mongodb\mongo.conf --service" start= auto'
  970. Pop $0
  971. Pop $1
  972. LogEx::Write "install lasermongodb-exitcode: $0,stdout:$1"
  973. SimpleSC::StartService "lasermongodb" "" 30
  974. Sleep 2000
  975. ;nsExec::ExecToStack '"cmd.exe" /c sc failure lasermongodb reset= 43200 actions= restart/60000/restart/86400//86400'
  976. ;nsExec::ExecToStack '"cmd.exe" /c sc failure laserredis reset= 43200 actions= restart/60000/restart/86400//86400'
  977. ;nsExec::ExecToStack '"cmd.exe" /c sc failure lasermysql reset= 43200 actions= restart/60000/restart/86400//86400'
  978. ; IfFileExists "$INSTDIR\USER_DATA\pro\*.*" 0 pro_not_found
  979. ; CopyFiles /SILENT $INSTDIR\USER_DATA\pro\*.* $INSTDIR\4DKK_PROGRAM_DATA
  980. ; RMDir /r "$INSTDIR\USER_DATA\pro"
  981. ; goto pro_end_of
  982. ; pro_not_found:
  983. ; goto pro_end_of
  984. ; pro_end_of:
  985. Sleep 2000
  986. ;
  987. ${StrRep} $0 '$INSTDIR\4DKK_PROGRAM_DATA\' '\' '\\'
  988. StrCpy $buildModelPath $0
  989. ${StrRep} $0 '$INSTDIR\4DKK_PROGRAM_STATIC\' '\' '\\'
  990. StrCpy $profilePath $0
  991. ${StrRep} $0 '$INSTDIR\CGAII' '\' '\\'
  992. StrCpy $buildCallPath $0
  993. ${StrRep} $0 '$INSTDIR\bin\resources\static' '\' '\\'
  994. StrCpy $binPath $0
  995. ${StrRep} $0 '$INSTDIR\jdk1.8\bin\java.exe' '\' '\\'
  996. StrCpy $javaPath $0
  997. ${StrRep} $0 '$INSTDIR\iReal3D\iReal3D\iReal3D.exe' '\' '\\'
  998. StrCpy $IREAL_PATH $0
  999. ${StrRep} $0 '$INSTDIR\smart3D\smart3D.exe' '\' '\\'
  1000. StrCpy $SMART3D_PATH $0
  1001. nsJSON::Set /file $INSTDIR\bin\resources\static\setting.json
  1002. nsJSON::Set /value `{}`
  1003. nsJSON::Set `sceneConfig` /value `"config.json"`
  1004. nsJSON::Set `sceheKey` /value `"id"`
  1005. nsJSON::Set `sceneBundle` /value `"./build.zip"`
  1006. nsJSON::Set `sceneBundleDir` /value `"capture"`
  1007. nsJSON::Set `buildModelPath` /value `"$buildModelPath"`
  1008. nsJSON::Set `javaPort` /value `9000`
  1009. nsJSON::Set `v4JavaPort` /value `9101`
  1010. nsJSON::Set `javaPath` /value `"$javaPath"`
  1011. nsJSON::Set `profilePath` /value `"$profilePath"`
  1012. nsJSON::Set `buildCallPath` /value `"$buildCallPath"`
  1013. nsJSON::Set `binPath` /value `"$binPath"`
  1014. nsJSON::Set `fuse` /value `${FUSE}`
  1015. nsJSON::Set `ver` /value `${VER}`
  1016. nsJSON::Set `version` /value `"${VERSION}"`
  1017. nsJSON::Set `isShowIreal` /value `${IS_SHOW_IREAL}`
  1018. nsJSON::Set `isShowSmart3D` /value `${IS_SHOW_SMART3D}`
  1019. nsJSON::Set `iReal` /value `"$IREAL_PATH"`
  1020. nsJSON::Set `smart3D` /value `"$SMART3D_PATH"`
  1021. nsJSON::Set `langList` /value `"${LANG_LIST}"`
  1022. nsJSON::Serialize /format /file $INSTDIR\bin\resources\static\setting.json
  1023. ;nsExec::ExecToStack "$INSTDIR\tools\laserOtherTools.exe -m l -i $INSTDIR"
  1024. nsExec::ExecToStack '"$INSTDIR\tools\service.bat" $INSTDIR '
  1025. nsExec::ExecToStack '"$INSTDIR\tools\update.bat" $INSTDIR '
  1026. ;;处理旧版本数据
  1027. ${IF} $OLD_VER != ""
  1028. ${VersionCompare} $OLD_VER "1.1.8.6" $R0
  1029. ${If} $R0 == "2"
  1030. nsExec::ExecToStack '"$INSTDIR\mongodb\update\update.bat" '
  1031. ${EndIf}
  1032. ${EndIf}
  1033. ; FileOpen $0 $INSTDIR\bin\resources\static\4dmega.vmoptions w
  1034. ; IfErrors done
  1035. ; FileWrite $0 '-DBIN_PATH=$INSTDIR\bin\resources\static$\n'
  1036. ; FileWrite $0 '-DPROFILE_PATH=$INSTDIR\4DKK_PROGRAM_STATIC\$\n'
  1037. ; FileWrite $0 '-DBUILD_MODEL_PATH=$INSTDIR\4DKK_PROGRAM_DATA\$\n'
  1038. ; FileWrite $0 '-DBUILD_CALL_PATH=$INSTDIR\CGAII\$\n'
  1039. ; FileWrite $0 '-Dspring.profiles.active=standAloneProd$\n'
  1040. ; FileWrite $0 '-Dserver.port=9000$\n'
  1041. ; FileClose $0
  1042. ; done:
  1043. ;nsExec::ExecToStack '"cmd.exe" /c $INSTDIR\tools\MonitorPid.exe install '
  1044. functionend
  1045. Function OnFinished
  1046. #MessageBox MB_YESNO|MB_ICONQUESTION "$(INSTALL_REBOOT)" IDNO +2
  1047. #Reboot
  1048. #Exec "$INSTDIR${EXE_NAME}"
  1049. # 调用PowerShell命令添加排除目录
  1050. nsExec::ExecToStack 'powershell -Command "Remove-MpPreference -ExclusionPath "$PLUGINSDIR""'
  1051. Call OnExitDUISetup
  1052. FunctionEnd
  1053. Function OnBtnSelectDir
  1054. nsNiuniuSkin::SelectInstallDirEx $hInstallDlg $(PLEASE_SELECT_INSTALLATION_PATH)
  1055. Pop $0
  1056. ${Unless} "$0" == ""
  1057. nsNiuniuSkin::SetControlAttribute $hInstallDlg "editDir" "text" $0
  1058. ${EndUnless}
  1059. FunctionEnd
  1060. Function StepHeightSizeAsc
  1061. ${ForEach} $R0 390 500 + 10
  1062. nsNiuniuSkin::SetWindowSize $hInstallDlg 480 $R0
  1063. Sleep 5
  1064. ${Next}
  1065. FunctionEnd
  1066. Function StepHeightSizeDsc
  1067. ${ForEach} $R0 480 390 - 10
  1068. nsNiuniuSkin::SetWindowSize $hInstallDlg 480 $R0
  1069. Sleep 5
  1070. ${Next}
  1071. FunctionEnd
  1072. Function OnBtnShowMore
  1073. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnShowMore" "enabled" "false"
  1074. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnHideMore" "enabled" "false"
  1075. nsNiuniuSkin::SetControlAttribute $hInstallDlg "moreconfiginfo" "visible" "true"
  1076. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnHideMore" "visible" "true"
  1077. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnShowMore" "visible" "false"
  1078. GetFunctionAddress $0 StepHeightSizeAsc
  1079. BgWorker::CallAndWait
  1080. nsNiuniuSkin::SetWindowSize $hInstallDlg 480 510
  1081. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnShowMore" "enabled" "true"
  1082. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnHideMore" "enabled" "true"
  1083. FunctionEnd
  1084. Function OnBtnHideMore
  1085. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnShowMore" "enabled" "false"
  1086. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnHideMore" "enabled" "false"
  1087. nsNiuniuSkin::SetControlAttribute $hInstallDlg "moreconfiginfo" "visible" "false"
  1088. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnHideMore" "visible" "false"
  1089. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnShowMore" "visible" "true"
  1090. GetFunctionAddress $0 StepHeightSizeDsc
  1091. BgWorker::CallAndWait
  1092. nsNiuniuSkin::SetWindowSize $hInstallDlg 480 390
  1093. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnShowMore" "enabled" "true"
  1094. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnHideMore" "enabled" "true"
  1095. FunctionEnd
  1096. Function OnBtnShowConfig
  1097. ;nsNiuniuSkin::ShowPageItem $hInstallDlg "wizardTab" ${INSTALL_PAGE_CONFIG}
  1098. nsNiuniuSkin::SetControlAttribute $hInstallDlg "licenseshow" "visible" "false"
  1099. FunctionEnd
  1100. Function OnBtnDirPre
  1101. StrCpy $R8 "$(CONFIRM_EXIT)"
  1102. StrCpy $R7 "0"
  1103. Call ShowMsgBox
  1104. ;nsNiuniuSkin::PrePage "wizardTab"
  1105. FunctionEnd
  1106. Function un.BtnDirPre
  1107. StrCpy $R8 "$(UNINSTALL)"
  1108. StrCpy $R7 "0"
  1109. Call un.ShowMsgBox
  1110. ;nsNiuniuSkin::PrePage "wizardTab"
  1111. FunctionEnd
  1112. Function un.ShowMsgBoxBackUps
  1113. nsNiuniuSkin::InitSkinSubPage "msgBox_backup.xml" "backupBtnOK" "gotouninstall"
  1114. Pop $hInstallSubDlg
  1115. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "lblMsg" "text" $(UNINSTALL_ERROR)
  1116. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "backupBtnOK" "text" $(I_KNOW)
  1117. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "lblTitle" "text" $(PROMPT)
  1118. nsNiuniuSkin::ShowSkinSubPage 0
  1119. FunctionEnd
  1120. Function un.ShowMsgBox
  1121. nsNiuniuSkin::InitSkinSubPage "msgBox.xml" "btnOK" "btnCancel,btnClose"
  1122. Pop $hInstallSubDlg
  1123. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "btnOK" "text" $(BTN_CONFIRM)
  1124. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "lblTitle" "text" $(PROMPT)
  1125. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "lblMsg" "text" "$R8"
  1126. ${If} "$R7" == "1"
  1127. nsNiuniuSkin::SetControlAttribute $hInstallSubDlg "hlCancel" "visible" "true"
  1128. ${EndIf}
  1129. nsNiuniuSkin::ShowSkinSubPage 0
  1130. FunctionEnd
  1131. Function un.ExitDUISetup
  1132. nsExec::ExecToStack 'ie4uinit.exe -ClearIconCache'
  1133. nsExec::ExecToStack 'ie4uinit.exe -show'
  1134. System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
  1135. ${RefreshShellIcons}
  1136. # 调用PowerShell命令添加排除目录
  1137. nsExec::ExecToStack 'powershell -Command "Remove-MpPreference -ExclusionPath "$PLUGINSDIR""'
  1138. nsExec::ExecToStack 'powershell -Command "Remove-MpPreference -ExclusionPath "$EXEDIR""'
  1139. nsNiuniuSkin::ExitDUISetup
  1140. FunctionEnd
  1141. Function un.OnBtnMin
  1142. SendMessage $hInstallDlg ${WM_SYSCOMMAND} 0xF020 0
  1143. FunctionEnd
  1144. Section "un.silentInstallSec" SEC02
  1145. #MessageBox MB_OK|MB_ICONINFORMATION "Test silent install. you can add your silent uninstall code here."
  1146. SectionEnd
  1147. Function un.onUninstall
  1148. nsProcess::_FindProcess "${EXE_NAME_EXT}"
  1149. Pop $R0
  1150. ${If} $R0 == 0
  1151. StrCpy $R8 "$(PRODUCT_NAME_LANG) $(TO_RUNNING)"
  1152. StrCpy $R7 "0"
  1153. Call un.ShowMsgBox
  1154. goto InstallAbort
  1155. ${EndIf}
  1156. nsNiuniuSkin::GetControlAttribute $hInstallDlg "chkbox_userdata" "selected"
  1157. Pop $0
  1158. StrCpy $sReserveData $0
  1159. ${If} $sReserveData == 1
  1160. nsNiuniuSkin::SetControlAttribute $hInstallDlg "un_progress_tip" "text" $(PREPARING_TO_UNINSTALL)
  1161. CreateDirectory $INSTDIR\USER_DATA
  1162. ; nsExec::ExecToStack "$INSTDIR\tools\laserOtherTools.exe -m v -i $INSTDIR"
  1163. ; Pop $0
  1164. SimpleSC::GetServiceStatus "lasermongodb"
  1165. Pop $0 ; 返回错误码,0 表示成功,非0 表示失败
  1166. Pop $1 ; 返回服务状态,状态值参考 Windows 服务状态代码
  1167. ${If} $0 == 0
  1168. ${If} $1 == 4 ; 服务状态值为 4 表示服务正在运行
  1169. Call un.onPassUninstall
  1170. ${Else}
  1171. RMDir /r "$INSTDIR\USER_DATA"
  1172. Call un.ShowMsgBoxBackUps
  1173. Pop $0
  1174. ${If} $0 == 0
  1175. Call un.onPassUninstall
  1176. ${EndIf}
  1177. ${If} $0 == 1
  1178. Call un.onNoPassUninstall
  1179. ${EndIf}
  1180. ${EndIf}
  1181. ${Else}
  1182. RMDir /r "$INSTDIR\USER_DATA"
  1183. Call un.ShowMsgBoxBackUps
  1184. Pop $0
  1185. ${If} $0 == 0
  1186. Call un.onPassUninstall
  1187. ${EndIf}
  1188. ${If} $0 == 1
  1189. Call un.onNoPassUninstall
  1190. ${EndIf}
  1191. ${EndIf}
  1192. ${Else}
  1193. Call un.onPassUninstall
  1194. ${EndIf}
  1195. InstallAbort:
  1196. FunctionEnd
  1197. Function un.onNoPassUninstall
  1198. nsNiuniuSkin::ExitDUISetup
  1199. FunctionEnd
  1200. Function un.onPassUninstall
  1201. ${If} $sReserveData == 1
  1202. CreateDirectory $INSTDIR\USER_DATA
  1203. ${EndIf}
  1204. Call un.initUninstallingPage
  1205. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnClose" "enabled" "false"
  1206. nsNiuniuSkin::ShowPageItem $hInstallDlg "wizardTab" ${INSTALL_PAGE_UNISTPROCESSING}
  1207. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrUnInstProgress" "min" "0"
  1208. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrUnInstProgress" "max" "100"
  1209. IntOp $UnInstallValue 0 + 1
  1210. nsNiuniuSkin::SetControlAttribute $hInstallDlg "un_progress_tip" "text" $(PREPARING_TO_UNINSTALL)
  1211. ; nsExec::ExecToStack "$INSTDIR\tools\laserOtherTools.exe -m b -i $INSTDIR "
  1212. ; BgWorker::CallAndWait
  1213. GetFunctionAddress $0 un.OnEnvDownInstall
  1214. BgWorker::CallAndWait
  1215. nsExec::ExecToStack 'cmd.exe /c powercfg.exe /hibernate on '
  1216. GetFunctionAddress $0 un.installService
  1217. BgWorker::CallAndWait
  1218. nsNiuniuSkin::SetControlAttribute $hInstallDlg "un_progress_tip" "text" $(UNINSTALLING)
  1219. Call un.DeleteShotcutAndInstallInfo
  1220. IntOp $UnInstallValue $UnInstallValue + 8
  1221. GetFunctionAddress $0 un.RemoveFiles
  1222. BgWorker::CallAndWait
  1223. FunctionEnd
  1224. Function un.RemoveFiles
  1225. ${Locate} "$INSTDIR" "/G=0 /M=*.*" "un.onDeleteFileFound"
  1226. StrCpy $InstallState "1"
  1227. ; 卸载成功后创建标记文件 0不用重启 1需要重启
  1228. WriteRegStr HKLM "Software\${PRODUCT_PATHNAME}" "reboot" 1
  1229. FileClose $0
  1230. ; 重启计算机
  1231. ; 创建任务计划程序命令
  1232. 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'
  1233. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnClose" "enabled" "true"
  1234. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrUnInstProgress" "value" "100"
  1235. Call un.initUninstallFinishPage
  1236. nsNiuniuSkin::ShowPageItem $hInstallDlg "wizardTab" ${INSTALL_PAGE_UNISTFINISH}
  1237. FunctionEnd
  1238. Function un.onDeleteFileFound
  1239. ; $R9 "path\name"
  1240. ; $R8 "path"
  1241. ; $R7 "name"
  1242. ; $R6 "size" ($R6 = "" if directory, $R6 = "0" if file with /S=)
  1243. ; MessageBox MB_OK "R9--------$R9"
  1244. ; MessageBox MB_OK "R8--------$R8"
  1245. ; MessageBox MB_OK "R7--------$R7"
  1246. ;不用保留场景
  1247. ${If} $sReserveData == 0
  1248. Delete "$R9"
  1249. RMDir /r "$R9"
  1250. RMDir "$R9"
  1251. ${EndIf}
  1252. ;保留场景
  1253. ${If} $sReserveData == 1
  1254. ${If} $R7 != "install.flag"
  1255. RMDir /r "$R8\bin"
  1256. RMDir /r "$R8\CGAII"
  1257. RMDir /r "$R8\mongodb"
  1258. RMDir /r "$R8\mysql"
  1259. RMDir /r "$R8\redis"
  1260. RMDir /r "$R8\jdk1.8"
  1261. ; RMDir /r "$R8\4DKK_PROGRAM_STATIC"
  1262. ; RMDir /r "$R8\4DKK_PROGRAM_DATA"
  1263. RMDir /r "$R8\tools"
  1264. Delete "$R8\uninst.exe"
  1265. ${EndIf}
  1266. ${EndIf}
  1267. IntOp $UnInstallValue $UnInstallValue + 2
  1268. ${If} $UnInstallValue > 100
  1269. IntOp $UnInstallValue 100 + 0
  1270. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrUnInstProgress" "value" "100"
  1271. ${Else}
  1272. nsNiuniuSkin::SetControlAttribute $hInstallDlg "slrUnInstProgress" "value" "$UnInstallValue"
  1273. nsNiuniuSkin::SetControlAttribute $hInstallDlg "un_progress_pos" "text" "$UnInstallValue%"
  1274. #Sleep 100
  1275. ${EndIf}
  1276. undelete:
  1277. Push "LocateNext"
  1278. FunctionEnd
  1279. #
  1280. # 以 Unicode 字符串的方式进行判断 (与 NSIS 是 ANSI/Unicode 无关)
  1281. # 但建议 Unicode 版本优先使用此函数。
  1282. #
  1283. Function PathIsDBCS_W
  1284. Exch $R0
  1285. Push $R1
  1286. Push $R2
  1287. Push $R3
  1288. System::Call "*(&w${NSIS_MAX_STRLEN}R0)p.R1"
  1289. StrCpy $R0 0
  1290. StrCpy $R2 $R1
  1291. lbl_loop:
  1292. # Unicode 版取 2 个字节长度的字符,字符串遇到 0 字符表示结束了。
  1293. System::Call "*$R2(&i2.R3)"
  1294. IntCmp $R3 0 lbl_done
  1295. # Unicode 字符直接判断字符值,大于 128 的我们就视为非英文字符。
  1296. IntCmp $R3 128 0 lbl_skip
  1297. IntOp $R0 $R0 !
  1298. Goto lbl_done
  1299. lbl_skip:
  1300. # 如果用 NSIS 3.x 这里可以用 IntPtrOp 代替。
  1301. IntOp $R2 $R2 + 2
  1302. Goto lbl_loop
  1303. lbl_done:
  1304. System::Free $R1
  1305. Pop $R3
  1306. Pop $R2
  1307. Pop $R1
  1308. Exch $R0
  1309. FunctionEnd
  1310. #
  1311. # 以 ANSI 字符串的方式进行判断 (与 NSIS 是 ANSI/Unicode 无关)
  1312. # 但建议 ANSI 版本优先使用此函数。
  1313. #
  1314. Function PathIsDBCS_A
  1315. Exch $R0
  1316. Push $R1
  1317. Push $R2
  1318. Push $R3
  1319. Push $R4
  1320. System::Call "*(&m${NSIS_MAX_STRLEN}R0)p.R1"
  1321. StrCpy $R0 0
  1322. StrCpy $R2 $R1
  1323. lbl_loop:
  1324. # ANSI 版取 1 个字节长度的字符,字符串遇到 0 字符表示结束了。
  1325. System::Call "*$R2(&i1.R3)"
  1326. IntCmp $R3 0 lbl_done
  1327. # ANSI 字符用 IsDBCSLeadByte 判断是否双字节字符的前导字节。
  1328. System::Call "kernel32::IsDBCSLeadByte(iR3)i.R4"
  1329. IntCmp $R4 0 lbl_skip
  1330. IntOp $R0 $R0 !
  1331. Goto lbl_done
  1332. lbl_skip:
  1333. # 用 CharNextA 得到下一个字符的地址 (可正确处理双字节字符)。
  1334. System::Call "user32::CharNextA(pR2)p.R2"
  1335. Goto lbl_loop
  1336. lbl_done:
  1337. Pop $R4
  1338. Pop $R3
  1339. Pop $R2
  1340. Pop $R1
  1341. Exch $R0
  1342. FunctionEnd
  1343. #
  1344. # 当选择的安装路径变更时,路径为空或包含双字节字符 (不限于简体中文),都不允许继续。
  1345. # 路径为空时,NSIS 会自行判断。
  1346. #
  1347. # 此示例未判断是否包含空格。如有需要,请与示例一配合使用。
  1348. #
  1349. Function onVerifyInstDir
  1350. # 检查安装路径是否包含双字节字符 (不限于简体中文)。
  1351. StrCpy $0 $INSTDIR
  1352. StrLen $1 $0
  1353. # 这里也可以换成 CheckEnglishPath 以测试效果。
  1354. ${If} $1 == 0
  1355. Push 2
  1356. ${Else}
  1357. Push $INSTDIR
  1358. Call PathIsDBCS_A
  1359. Pop $R0
  1360. Push $R0
  1361. ${endif}
  1362. lbl_done:
  1363. FunctionEnd
  1364. Function CheckEnglishPath
  1365. Exch $0 ; 保存返回值的变量
  1366. Exch ; 将字符串参数放在栈顶
  1367. Push $1
  1368. Push $2
  1369. Push $3
  1370. StrLen $1 $0 ; 计算字符串长度
  1371. loop:
  1372. StrCpy $2 $1 ; 复制当前长度
  1373. IntOp $1 $1 - 1 ; 长度减1
  1374. StrCpy $3 $0 1 $2 ; 获取当前字符
  1375. ${If} $3 == " " ; 如果字符是空格
  1376. Goto notEnglish ; 跳转到不是英文路径的逻辑
  1377. ${EndIf}
  1378. ${If} $1 > 0 ; 如果还有字符未检查
  1379. Goto loop ; 继续循环
  1380. ${EndIf}
  1381. ; 路径是全英文的
  1382. Pop $3
  1383. Pop $2
  1384. Pop $1
  1385. StrCpy $0 0
  1386. Exch $0
  1387. notEnglish:
  1388. ; 路径不是全英文的
  1389. Pop $3
  1390. Pop $2
  1391. Pop $1
  1392. StrCpy $0 1
  1393. Exch $0
  1394. FunctionEnd
  1395. Function onVerifySpecialInstDir
  1396. # 检查安装路径是否包含双字节字符 (不限于简体中文)。
  1397. StrCpy $0 $INSTDIR
  1398. StrLen $1 $0
  1399. # 这里也可以换成 PathIsDBCS_A 以测试效果。
  1400. ${If} $1 == 0
  1401. Push 2
  1402. ${Else}
  1403. Push $INSTDIR
  1404. Call CheckSpecialCharacters
  1405. Pop $0 ; 获取返回结果
  1406. Push $R0
  1407. ${endif}
  1408. FunctionEnd
  1409. Function CheckSpecialCharacters
  1410. Exch $0 ; 保存返回值的变量
  1411. Exch ; 将字符串参数放在栈顶
  1412. StrCpy $1 "!@#¥%……&*()!@#$%^&*()<>_+{}[];'?.,~`" ; 特殊字符
  1413. StrCpy $2 0 ; 特殊字符字符串索引
  1414. StrCpy $3 0 ; 字符串索引
  1415. StrLen $4 $0 ; 特殊字符字符串长度
  1416. loop:
  1417. StrCpy $5 $1 1 $2 ; 从特殊字符字符串中获取一个字符
  1418. StrCpy $6 $0 1 $3 ; 从需要检查的字符串中获取一个字符
  1419. StrCmp $5 "" done ; 如果特殊字符字符串已经检查完,跳转到 done
  1420. StrCmp $6 "" next ; 如果需要检查的字符串已经检查完,跳转到 next
  1421. StrCmp $5 $6 found ; 如果找到特殊字符,跳转到 found
  1422. IntOp $3 $3 + 1 ; 否则,增加需要检查的字符串的索引
  1423. Goto loop
  1424. next:
  1425. IntOp $2 $2 + 1 ; 增加特殊字符字符串的索引
  1426. StrCpy $3 0 ; 重置需要检查的字符串的索引
  1427. Goto loop
  1428. found:
  1429. StrCpy $0 "1"
  1430. Goto End
  1431. done:
  1432. StrCpy $0 "0"
  1433. end:
  1434. Exch $0 ; 将返回值出栈
  1435. FunctionEnd
  1436. Function isEmptyDir
  1437. # Stack -> # Stack: <directory>
  1438. Exch $0 # Stack: $0
  1439. Push $1 # Stack: $1, $0
  1440. FindFirst $0 $1 "$0\*.*"
  1441. strcmp $1 "." 0 _notempty
  1442. FindNext $0 $1
  1443. strcmp $1 ".." 0 _notempty
  1444. ClearErrors
  1445. FindNext $0 $1
  1446. IfErrors 0 _notempty
  1447. FindClose $0
  1448. Pop $1 # Stack: $0
  1449. StrCpy $0 1
  1450. Exch $0 # Stack: 1 (true)
  1451. goto _end
  1452. _notempty:
  1453. FindClose $0
  1454. ClearErrors
  1455. Pop $1 # Stack: $0
  1456. StrCpy $0 0
  1457. Exch $0 # Stack: 0 (false)
  1458. _end:
  1459. FunctionEnd
  1460. Function un.isEmptyDir
  1461. # Stack -> # Stack: <directory>
  1462. Exch $0 # Stack: $0
  1463. Push $1 # Stack: $1, $0
  1464. FindFirst $0 $1 "$0\*.*"
  1465. strcmp $1 "." 0 _notempty
  1466. FindNext $0 $1
  1467. strcmp $1 ".." 0 _notempty
  1468. ClearErrors
  1469. FindNext $0 $1
  1470. IfErrors 0 _notempty
  1471. FindClose $0
  1472. Pop $1 # Stack: $0
  1473. StrCpy $0 1
  1474. Exch $0 # Stack: 1 (true)
  1475. goto _end
  1476. _notempty:
  1477. FindClose $0
  1478. ClearErrors
  1479. Pop $1 # Stack: $0
  1480. StrCpy $0 0
  1481. Exch $0 # Stack: 0 (false)
  1482. _end:
  1483. FunctionEnd
  1484. Function initRegPage
  1485. nsNiuniuSkin::SetControlAttribute $hInstallDlg "reg_title" "bkimage" $(REG_TITLE)
  1486. nsNiuniuSkin::SetControlAttribute $hInstallDlg "install_info" "text" $(INSTALL_INFO)
  1487. nsNiuniuSkin::SetControlAttribute $hInstallDlg "machineCode" "text" $(MACHINE_CODE)
  1488. nsNiuniuSkin::SetControlAttribute $hInstallDlg "reg_machine_info" "text" $(REG_MACHINE_INFO)
  1489. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnCopyMachineinfo" "text" $(BTN_COPY_MACHINEINFO)
  1490. nsNiuniuSkin::SetControlAttribute $hInstallDlg "installKey" "text" $(INSTALL_KEY)
  1491. nsNiuniuSkin::SetControlAttribute $hInstallDlg "regPrompt" "text" $(REG_PROMPT)
  1492. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnRegConfirm" "text" $(BTN_REG_CONFIRM)
  1493. FunctionEnd
  1494. Function initConfigPage
  1495. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configPageTitle" "bkimage" $(CONFIG_PAGE_TITLE)
  1496. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPath" "text" $(CONFIG_INSTALL_PATH)
  1497. nsNiuniuSkin::SetControlAttribute $hInstallDlg "chkAgree" "text" $(CONFIG_CHK_AGREE)
  1498. ${If} $LANGUAGE == '1033'
  1499. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPath" "width" 115
  1500. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPathTip" "width" 310
  1501. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPathTip" "font" 11
  1502. ${ElseIf} $LANGUAGE == '1041'
  1503. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPath" "width" 100
  1504. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPathTip" "font" 5
  1505. nsNiuniuSkin::SetControlAttribute $hInstallDlg "chkAgree" "width" 190
  1506. ${ElseIf} $LANGUAGE == '1042'
  1507. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPath" "width" 70
  1508. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPathTip" "font" 5
  1509. ${ElseIf} $LANGUAGE == '2052'
  1510. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPath" "width" 60
  1511. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPathTip" "font" 5
  1512. ${EndIf}
  1513. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configInstallPathTip" "text" $(CONFIG_INSTALL_PATH_TIP)
  1514. nsNiuniuSkin::SetControlAttribute $hInstallDlg "configUseSpace" "text" $(CONFIG_USE_SPACE)
  1515. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnAgreement" "text" $(CONFIG_BTN_AGREEMENT)
  1516. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnInstall" "text" $(CONFIG_BTN_INSTALL)
  1517. FunctionEnd
  1518. Function initLicensePage
  1519. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnAgree" "text" $(LICENSE_BTN_AGREE)
  1520. FunctionEnd
  1521. Function initInstallingPage
  1522. nsNiuniuSkin::SetControlAttribute $hInstallDlg "InstallingTitle" "bkimage" $(INSTALLING_TITLE)
  1523. FunctionEnd
  1524. Function initFinishPage
  1525. nsNiuniuSkin::SetControlAttribute $hInstallDlg "FinishPageTitle" "bkimage" $(FINISH_PAGE_TITLE)
  1526. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnRun" "text" $(BTN_RUN)
  1527. FunctionEnd
  1528. Function un.initUnInstallPage
  1529. nsNiuniuSkin::SetControlAttribute $hInstallDlg "unInstallTitle" "bkimage" $(UN_INSTALL_TITLE)
  1530. nsNiuniuSkin::SetControlAttribute $hInstallDlg "unInstallPrompt" "text" $(UN_INSTALL_PROMPT)
  1531. nsNiuniuSkin::SetControlAttribute $hInstallDlg "chkbox_userdata" "text" $(UN_INSTALL_CHKBOX_USERDATA)
  1532. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnUnInstall" "text" $(BTN_CONFIRM)
  1533. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnUnClose" "text" $(BTN_CANCEL)
  1534. FunctionEnd
  1535. Function un.initUninstallingPage
  1536. nsNiuniuSkin::SetControlAttribute $hInstallDlg "unInstallingTitle" "bkimage" $(UN_INSTALL_TITLE)
  1537. FunctionEnd
  1538. Function un.initUninstallFinishPage
  1539. nsNiuniuSkin::SetControlAttribute $hInstallDlg "unInstallFinishTitle" "bkimage" $(UN_INSTALL_TITLE)
  1540. nsNiuniuSkin::SetControlAttribute $hInstallDlg "unInstallFinishPrompt" "text" $(UN_INSTALL_FINISH_PROMPT)
  1541. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnUninstalled" "text" $(BTN_UNINSTALLED)
  1542. nsNiuniuSkin::SetControlAttribute $hInstallDlg "btnUninstalledReboot" "text" $(BTN_UNINSTALLED_REBOOT)
  1543. FunctionEnd