ui_laser_setup.nsh 124 KB

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