ui_laser_setup.nsh 123 KB

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