ui_laser_setup.nsh 123 KB

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