flyinsono.iss 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  1. #define SetupAppName "vital"
  2. #define SetupAppPublisher "VINNO Technology (Suzhou) Co., Ltd ."
  3. #define SetupAppURL "http://www.flyinsono.com"
  4. #define SetupAppExeName "fis.exe"
  5. #define CopyRight "Copyright ?2022 VINNO Corporation. All rights reserved."
  6. [setup]
  7. AppId={{508D995C-BDEF-44B0-B162-D480D7180324}
  8. AppName={cm:SetupAppName}
  9. AppVersion={#SetupAppVersion}
  10. AppVerName={cm:SetupAppName} {#SetupAppVersion}
  11. DefaultDirName={userappdata}\{cm:SetupAppName}
  12. OutputBaseFilename=vital
  13. VersionInfoDescription={#SetupAppName}
  14. VersionInfoProductName={#SetupAppName}
  15. VersionInfoCopyright={#CopyRight}
  16. VersionInfoVersion={#SetupAppVersion}
  17. SetupIconFile=flyinsono.ico
  18. UninstallDisplayIcon={app}\flyinsono.ico
  19. OutputDir={#SetupOutputDir}
  20. Compression=lzma2
  21. DisableWelcomePage=yes
  22. DisableReadyPage=yes
  23. DisableProgramGroupPage=yes
  24. DirExistsWarning=no
  25. LanguageDetectionMethod=uilanguage
  26. ShowLanguageDialog=no
  27. ArchitecturesAllowed=x64
  28. ChangesAssociations=yes
  29. [Languages]
  30. Name: "english"; MessagesFile: "compiler:Languages\English.isl"
  31. Name: "chinese"; MessagesFile: "compiler:Languages\ChineseSimp.isl"
  32. [CustomMessages]
  33. english.SetupAppName=Vital
  34. english.SetupWizarde=Setup Wizard
  35. english.FinishedRestartMessage=To complete the installation of [Flyinsono], Setup must restart your computer.%n%nWould you like to restart now?
  36. english.NotSupportXP=Windows XP is not supported.
  37. english.NotSupportWin7=Windows 7 (without SP1) is not supported. %n%nWould you like to download the Windows 7 SP1 patch now?
  38. chinese.SetupAppName=杏聆荟健康平台
  39. chinese.SetupWizarde=安装向导
  40. chinese.FinishedRestartMessage=为了完成 [杏聆荟健康平台] 的安装,安装向导必须重启电脑。%n%n你要立即重启吗?
  41. chinese.NotSupportXP=杏聆荟健康平台软件无法在Windows XP系统上进行安装。
  42. chinese.NotSupportWin7=杏聆荟健康平台软件无法在未安装SP1补丁的Windows 7系统上进行安装。%n%n你要下载Windows 7 SP1 补丁吗?
  43. [Messages]
  44. english.SetupAppTitle=Flyinsono Setup Wizard
  45. english.SetupWindowTitle=Flyinsono Setup Wizard
  46. chinese.SetupAppTitle=杏聆荟健康平台安装向导
  47. chinese.SetupWindowTitle=杏聆荟健康平台安装向导
  48. [Files]
  49. //onlyifdoesntexist 仅在文件不存在的时候 安装
  50. Source: resource\*; DestDir: {tmp}; Flags: dontcopy solidbreak ; Attribs: hidden system
  51. Source: {#ProjectFolder}\App\*; DestDir: "{app}\App"; Flags: ignoreversion recursesubdirs createallsubdirs; BeforeInstall: BeforeInstallFis
  52. Source: {#ProjectFolder}\CefGlueBrowserProcess\*; DestDir: "{app}\CefGlueBrowserProcess"; Flags: ignoreversion recursesubdirs createallsubdirs;
  53. Source: {#ProjectFolder}\SmartPublisher\*; DestDir: "{app}\SmartPublisher"; Flags: ignoreversion recursesubdirs createallsubdirs;
  54. Source: {#ProjectFolder}\RtmpServer\*; DestDir: "{app}\RtmpServer"; Flags: ignoreversion recursesubdirs createallsubdirs;
  55. Source: {#ProjectFolder}\swiftshader\*; DestDir: "{app}\swiftshader"; Flags: ignoreversion recursesubdirs createallsubdirs;
  56. Source: {#ProjectFolder}\IDCard\*; DestDir: "{app}\IDCard"; Flags: ignoreversion recursesubdirs createallsubdirs;
  57. Source: {#ProjectFolder}\sonopost\*; DestDir: "{app}\sonopost"; Flags: ignoreversion recursesubdirs createallsubdirs;
  58. Source: {#ProjectFolder}\autoreplyprint.dll; DestDir: "{app}"; Flags: ignoreversion;
  59. Source: {#ProjectFolder}\cef.pak; DestDir: "{app}"; Flags: ignoreversion;
  60. Source: {#ProjectFolder}\FisPrintDrive.exe; DestDir: "{app}"; Flags: ignoreversion;
  61. Source: {#ProjectFolder}\cef_100_percent.pak; DestDir: "{app}"; Flags: ignoreversion;
  62. Source: {#ProjectFolder}\cef_200_percent.pak; DestDir: "{app}"; Flags: ignoreversion;
  63. Source: {#ProjectFolder}\cef_extensions.pak; DestDir: "{app}"; Flags: ignoreversion;
  64. Source: {#ProjectFolder}\chrome_elf.dll; DestDir: "{app}"; Flags: ignoreversion;
  65. Source: {#ProjectFolder}\concrt140.dll; DestDir: "{app}"; Flags: ignoreversion;
  66. Source: {#ProjectFolder}\cvextern.dll; DestDir: "{app}"; Flags: ignoreversion;
  67. Source: {#ProjectFolder}\d3dcompiler_47.dll; DestDir: "{app}"; Flags: ignoreversion;
  68. Source: {#ProjectFolder}\devtools_resources.pak; DestDir: "{app}"; Flags: ignoreversion;
  69. Source: {#ProjectFolder}\fis.exe; DestDir: "{app}"; Flags: ignoreversion;
  70. Source: {#ProjectFolder}\flyinsono.ico; DestDir: "{app}"; Flags: ignoreversion;
  71. Source: {#ProjectFolder}\icudtl.dat; DestDir: "{app}"; Flags: ignoreversion;
  72. Source: {#ProjectFolder}\libcef.dll; DestDir: "{app}"; Flags: ignoreversion;
  73. Source: {#ProjectFolder}\libEGL.dll; DestDir: "{app}"; Flags: ignoreversion;
  74. Source: {#ProjectFolder}\libGLESv2.dll; DestDir: "{app}"; Flags: ignoreversion;
  75. Source: {#ProjectFolder}\libHarfBuzzSharp.dll; DestDir: "{app}"; Flags: ignoreversion;
  76. Source: {#ProjectFolder}\libSkiaSharp.dll; DestDir: "{app}"; Flags: ignoreversion;
  77. Source: {#ProjectFolder}\msvcp140.dll; DestDir: "{app}"; Flags: ignoreversion;
  78. Source: {#ProjectFolder}\msvcp140_1.dll; DestDir: "{app}"; Flags: ignoreversion;
  79. Source: {#ProjectFolder}\msvcp140_2.dll; DestDir: "{app}"; Flags: ignoreversion;
  80. Source: {#ProjectFolder}\msvcp140_atomic_wait.dll; DestDir: "{app}"; Flags: ignoreversion;
  81. Source: {#ProjectFolder}\msvcp140_codecvt_ids.dll; DestDir: "{app}"; Flags: ignoreversion;
  82. Source: {#ProjectFolder}\snapshot_blob.bin; DestDir: "{app}"; Flags: ignoreversion;
  83. Source: {#ProjectFolder}\v8_context_snapshot.bin; DestDir: "{app}"; Flags: ignoreversion;
  84. Source: {#ProjectFolder}\vcruntime140.dll; DestDir: "{app}"; Flags: ignoreversion;
  85. Source: {#ProjectFolder}\vcruntime140_1.dll; DestDir: "{app}"; Flags: ignoreversion;
  86. Source: {#ProjectFolder}\resources.pak; DestDir: "{app}"; Flags: ignoreversion;
  87. Source: {#ProjectFolder}\Versions.txt; DestDir: "{app}"; Flags: ignoreversion;
  88. Source: {#ProjectFolder}\fis.Upgrader.exe; DestDir: "{app}"; Flags: ignoreversion;
  89. Source: extra\en-US.pak; DestDir: "{app}\locales"; Flags: ignoreversion;
  90. Source: extra\zh-CN.pak; DestDir: "{app}\locales"; Flags: ignoreversion;
  91. Source: extra\zh-TW.pak; DestDir: "{app}\locales"; Flags: ignoreversion;
  92. Source: extra\ru.pak; DestDir: "{app}\locales"; Flags: ignoreversion;
  93. Source: extra\dotnet-runtime-6.0.0-win-x64.exe; DestDir: "{app}"; Flags: ignoreversion;
  94. Source: extra\Windows6.1-KB3063858-x64.msu; DestDir: "{app}"; Flags: ignoreversion;
  95. Source: extra\loader.exe; DestDir: "{app}"; Flags: ignoreversion;
  96. //桌面快捷方式
  97. [Icons]
  98. Name: "{group}\{cm:SetupAppName}"; Filename: "{app}\loader.exe"; IconFilename: "{app}\flyinsono.ico";
  99. Name: "{commondesktop}\{cm:SetupAppName}"; Filename: "{app}\loader.exe"; IconFilename: "{app}\flyinsono.ico";
  100. [Run]
  101. Filename: "{app}\Windows6.1-KB3063858-x64.msu"; Parameters: "/quiet /norestart"; Flags: runascurrentuser shellexec; Check:NeedInstallKB3063858
  102. Filename: "{app}\dotnet-runtime-6.0.0-win-x64.exe"; Parameters: "/quiet"; Flags: runascurrentuser; Check:NeedInstallDotnet6
  103. [UninstallRun]
  104. Filename: "taskkill.exe"; Parameters: "/f /t /im FlyinsonoDaemon.exe"; Flags: runhidden
  105. Filename: "taskkill.exe"; Parameters: "/f /t /im loader.exe"; Flags: runhidden
  106. Filename: "taskkill.exe"; Parameters: "/f /im Xilium.CefGlue.BrowserProcess.exe"; Flags: runhidden
  107. Filename: "taskkill.exe"; Parameters: "/f /t /im fis.exe"; Flags: runhidden
  108. [code]
  109. #include 'dll.iss'
  110. const
  111. SHCNE_ASSOCCHANGED = $08000000;
  112. SHCNF_IDLIST = $00000000;
  113. var
  114. BackgroundImage, LicenseBackgroundImage, ProgressBarBackgroundImage,ProgressBarImage, MinButton,CloseButton, SetupButton, SelectFolderButton,LicenseCheckBox,LicenseButton, LicenseBackButton, CustomSetupButton:HWND;
  115. CustomPathEdit:TEdit;
  116. LicenseRichEditViewer:TRichEditViewer;
  117. AdPlayerTimer: TTimer;
  118. ProgressBarMessageHandler:LongInt;
  119. CustomSetup,NormalSetup:boolean;
  120. RestartRequired: boolean;
  121. procedure SHChangeNotify(wEventID: integer; uFlags: cardinal; dwItem1, dwItem2: cardinal); external 'SHChangeNotify@shell32.dll stdcall';
  122. procedure SendChangeNotification;
  123. begin
  124. SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
  125. end;
  126. procedure TaskKill(FileName: String);
  127. var
  128. ResultCode: Integer;
  129. begin
  130. Exec(ExpandConstant('taskkill.exe'),'/f /im ' + '"' + FileName + '"','',SW_HIDE,ewWaitUntilTerminated,ResultCode);
  131. end;
  132. procedure BeforeInstallFis();
  133. begin
  134. TaskKill('FlyinsonoDaemon.exe');
  135. TaskKill('loader.exe');
  136. TaskKill('Xilium.CefGlue.BrowserProcess.exe');
  137. TaskKill('fis.exe');
  138. TaskKill('Sonopost.exe');
  139. end;
  140. function IsWindowsXPOr2000: Boolean;
  141. var
  142. Version: TWindowsVersion;
  143. begin
  144. GetWindowsVersionEx(Version);
  145. if Version.Major = 5 then
  146. begin
  147. Result := True;
  148. end
  149. else
  150. begin
  151. Result := False;
  152. end;
  153. end;
  154. function IsWindows7:Boolean;
  155. var
  156. Version: TWindowsVersion;
  157. begin
  158. GetWindowsVersionEx(Version);
  159. if (Version.Major = 6) and (Version.Minor = 1) then
  160. begin
  161. if Version.ServicePackMajor = 0 then
  162. begin
  163. Result := True;
  164. end
  165. else
  166. begin
  167. Result := False;
  168. end;
  169. end
  170. else
  171. begin
  172. Result := False;
  173. end;
  174. end;
  175. function IsWindows7SP1:Boolean;
  176. var
  177. Version: TWindowsVersion;
  178. begin
  179. GetWindowsVersionEx(Version);
  180. if (Version.Major =6) and (Version.Minor = 1) then
  181. begin
  182. if Version.ServicePackMajor = 1 then
  183. begin
  184. Result := True;
  185. end
  186. else
  187. begin
  188. Result := False;
  189. end;
  190. end
  191. else
  192. begin
  193. Result := False;
  194. end;
  195. end;
  196. function IsDotnet6Installed: boolean;
  197. begin
  198. Result := False;
  199. if FileExists('C:\Program Files\dotnet\host\fxr\6.0.0\hostfxr.dll') then
  200. begin
  201. Result := True;
  202. end
  203. else
  204. begin
  205. Result := False;
  206. end;
  207. end;
  208. function NeedInstallKB3063858: boolean;
  209. begin
  210. if (not IsDotnet6Installed) and (IsWindows7SP1) then
  211. begin
  212. RestartRequired := true;
  213. Result := True;
  214. end
  215. else
  216. begin
  217. RestartRequired := false;
  218. Result := False;
  219. end;
  220. end;
  221. function NeedInstallDotnet6: boolean;
  222. begin
  223. Result := not IsDotnet6Installed;
  224. end;
  225. procedure RestartOS();
  226. var
  227. Params: string;
  228. ErrorCode: Integer;
  229. begin
  230. Params := '-r -t 0';
  231. //Exec('shutdown', Params, '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
  232. ShellExec('', 'shutdown',Params, '', SW_HIDE, ewNoWait, ErrorCode);
  233. end;
  234. procedure OnCloseButtonClick(HButton:HWND);
  235. begin
  236. WizardForm.CancelButton.Click;
  237. end;
  238. procedure OnMinButtonClick(HButton:HWND);
  239. begin
  240. SendMessage(WizardForm.Handle,WM_SYSCOMMAND,61472,0);
  241. end;
  242. procedure OnCustomSetupButtonClick(HButton:HWND);
  243. begin
  244. if CustomSetup then
  245. begin
  246. BtnSetPosition(LicenseCheckBox,22,475,15,15);
  247. if ExpandConstant('{language}') = 'chinese' then
  248. begin
  249. BtnSetPosition(LicenseButton,100,475,108,15);
  250. BtnSetPosition(CustomSetupButton,560,479,75,15);
  251. end
  252. else
  253. begin
  254. BtnSetPosition(LicenseButton,100,475,167,15);
  255. BtnSetPosition(CustomSetupButton,522,479,113,15);
  256. end;
  257. CustomPathEdit.Show;
  258. BtnSetVisibility(SelectFolderButton,true)
  259. WizardForm.Height:=508
  260. BackgroundImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_custom_setup_{language}.png'),0,0,650,508,true,true);
  261. CustomSetup := false
  262. end
  263. else
  264. begin
  265. BtnSetPosition(LicenseCheckBox,22,421,15,15);
  266. if ExpandConstant('{language}') = 'chinese' then
  267. begin
  268. BtnSetPosition(LicenseButton,100,421,108,15);
  269. BtnSetPosition(CustomSetupButton,560,421,75,15);
  270. end
  271. else
  272. begin
  273. BtnSetPosition(LicenseButton,100,421,167,15);
  274. BtnSetPosition(CustomSetupButton,522,421,113,15);
  275. end;
  276. CustomPathEdit.Hide;
  277. BtnSetVisibility(SelectFolderButton,false)
  278. WizardForm.Height:=450
  279. BackgroundImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_normal_{language}.png'),0,0,650,450,false,true);
  280. CustomSetup := true
  281. end;
  282. ImgApplyChanges(WizardForm.Handle)
  283. end;
  284. procedure OnSelectFolderButtonclick(HButton:HWND);
  285. begin
  286. WizardForm.DirBrowseButton.Click;
  287. CustomPathEdit.text := WizardForm.DirEdit.text;
  288. end;
  289. procedure CustomPathEditChange(Sender: TObject);
  290. begin
  291. if CustomPathEdit.Text <> '' then
  292. begin
  293. WizardForm.DirEdit.text:=CustomPathEdit.Text;
  294. end;
  295. end;
  296. procedure OnLicenseCheckBoxClick(HButton:HWND);
  297. begin
  298. if BtnGetChecked(LicenseCheckBox)=true then
  299. begin
  300. BtnSetEnabled(SetupButton,true)
  301. end
  302. else
  303. begin
  304. BtnSetEnabled(SetupButton,false)
  305. end
  306. end;
  307. procedure OnSetupButtonClick(HButton:HWND);
  308. begin
  309. WizardForm.NextButton.Click;
  310. end;
  311. procedure OnFinishButtonClick(HButton:HWND);
  312. var
  313. ErrorCode: Integer;
  314. begin
  315. SendChangeNotification;
  316. if RestartRequired then
  317. begin
  318. if MsgBox(CustomMessage('FinishedRestartMessage'),mbConfirmation,MB_YESNO) = IDYES then
  319. begin
  320. RestartOS();
  321. end;
  322. end;
  323. ShellExec('open', ExpandConstant('{app}\loader.exe'),'', '', SW_SHOW, ewNoWait, ErrorCode);
  324. WizardForm.NextButton.Click;
  325. end;
  326. function ProcessProgressBarMessage(h:hWnd;Msg,wParam,lParam:Longint):Longint;
  327. var
  328. pr,i1,i2 : Extended;
  329. w : Integer;
  330. begin
  331. Result:=CallWindowProc(ProgressBarMessageHandler,h,Msg,wParam,lParam);
  332. if (Msg=$402) and (WizardForm.ProgressGauge.Position>WizardForm.ProgressGauge.Min) then
  333. begin
  334. i1:=WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min;
  335. i2:=WizardForm.ProgressGauge.Max-WizardForm.ProgressGauge.Min;
  336. pr:=i1*100/i2;
  337. w:=Round(650*pr/100);
  338. ImgSetPosition(ProgressBarImage,0,375,w,15);
  339. ImgSetVisiblePart(ProgressBarImage,0,0,w,15);
  340. ImgApplyChanges(WizardForm.Handle);
  341. end;
  342. end;
  343. procedure OnWizardMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  344. begin
  345. ReleaseCapture;
  346. SendMessage(WizardForm.Handle, $0112, $F012, 0);
  347. end;
  348. var
  349. b1,b2,b3,b4,t1,t2,t3,t4:Longint;
  350. playStep:Integer;
  351. playIndex:Integer;
  352. waitTime:Integer;
  353. procedure OnAdPlayerTimerTimer(Sender: TObject); //核心代码 时钟控制动画 需要inno5 增强版
  354. begin
  355. if playIndex > 5 then
  356. begin
  357. playIndex := 1;
  358. playStep := 0;
  359. end;
  360. if waitTime >0 then
  361. begin
  362. waitTime := waitTime - 10;
  363. Exit;
  364. end;
  365. playStep := playStep + 10;
  366. if playStep<=650 then
  367. begin
  368. //控制显示图片
  369. if playIndex=1 then
  370. begin
  371. ImgSetPosition(t1,-650+playStep,0,650,374);
  372. ImgSetVisibility(t2,false);
  373. ImgSetVisibility(t3,false);
  374. ImgSetVisibility(t4,false);
  375. ImgSetVisibility(t1,true);
  376. end;
  377. if playIndex=2 then
  378. begin
  379. ImgSetPosition(t2,-650+playStep,0,650,374);
  380. ImgSetVisibility(t1,false);
  381. ImgSetVisibility(t3,false);
  382. ImgSetVisibility(t4,false);
  383. ImgSetVisibility(t2,true);
  384. ImgSetVisibility(b1,true);
  385. ImgSetVisibility(b3,false);
  386. ImgSetVisibility(b4,false);
  387. ImgSetVisibility(b2,false);
  388. end;
  389. if playIndex=3 then
  390. begin
  391. ImgSetPosition(t3,-650+playStep,0,650,374);
  392. ImgSetVisibility(t1,false);
  393. ImgSetVisibility(t2,false);
  394. ImgSetVisibility(t4,false);
  395. ImgSetVisibility(t3,true);
  396. ImgSetVisibility(b1,false);
  397. ImgSetVisibility(b3,false);
  398. ImgSetVisibility(b4,false);
  399. ImgSetVisibility(b2,true);
  400. end;
  401. if playIndex=4 then
  402. begin
  403. ImgSetPosition(t4,-650+playStep,0,650,374);
  404. ImgSetVisibility(t1,false);
  405. ImgSetVisibility(t2,false);
  406. ImgSetVisibility(t3,false);
  407. ImgSetVisibility(t4,true);
  408. ImgSetVisibility(b1,false);
  409. ImgSetVisibility(b3,true);
  410. ImgSetVisibility(b4,false);
  411. ImgSetVisibility(b2,false);
  412. end ;
  413. if playIndex=5 then
  414. begin
  415. ImgSetPosition(t1,-650+playStep,0,650,374);
  416. ImgSetVisibility(t2,false);
  417. ImgSetVisibility(t3,false);
  418. ImgSetVisibility(t4,false);
  419. ImgSetVisibility(t1,true);
  420. ImgSetVisibility(b1,false);
  421. ImgSetVisibility(b3,false);
  422. ImgSetVisibility(b4,true);
  423. ImgSetVisibility(b2,false);
  424. end;
  425. end;
  426. if playStep >= 650 then
  427. begin
  428. waitTime := 2000;
  429. playIndex := playIndex + 1;
  430. playStep := 0;
  431. end;
  432. ImgApplyChanges(WizardForm.Handle)
  433. end;
  434. procedure OnLicenseBackButtonClick(HButton:HWND);
  435. begin
  436. if CustomSetup=false then
  437. begin
  438. BtnSetPosition(LicenseCheckBox,22,421,15,15);
  439. if ExpandConstant('{language}') = 'chinese' then
  440. begin
  441. BtnSetPosition(LicenseButton,100,421,108,15);
  442. BtnSetPosition(CustomSetupButton,560,421,75,15);
  443. end
  444. else
  445. begin
  446. BtnSetPosition(LicenseButton,100,421,167,15);
  447. BtnSetPosition(CustomSetupButton,522,421,113,15);
  448. end;
  449. CustomPathEdit.Hide;
  450. BtnSetVisibility(SelectFolderButton,false)
  451. WizardForm.Height:=450
  452. BackgroundImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_normal_{language}.png'),0,0,650,450,false,true);
  453. CustomSetup := true
  454. end;
  455. if NormalSetup=true then
  456. begin
  457. LicenseBackgroundImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_license_{language}.png'),0,0,650,450,false,false);
  458. NormalSetup:=false
  459. LicenseRichEditViewer.Height:=321
  460. BtnSetVisibility(LicenseCheckBox,false)
  461. BtnSetVisibility(LicenseButton,false)
  462. BtnSetVisibility(CustomSetupButton,false)
  463. BtnSetVisibility(SetupButton,false)
  464. BtnSetVisibility(LicenseBackButton,true)
  465. end
  466. else
  467. begin
  468. NormalSetup:=true
  469. BackgroundImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_normal_{language}.png'),0,0,650,450,false,true);
  470. LicenseRichEditViewer.Height:=0
  471. BtnSetVisibility(LicenseCheckBox,true)
  472. BtnSetVisibility(LicenseButton,true)
  473. BtnSetVisibility(CustomSetupButton,true)
  474. BtnSetVisibility(SetupButton,true)
  475. ImgRelease(LicenseBackgroundImage)
  476. BtnSetVisibility(LicenseBackButton,false)
  477. end;
  478. ImgApplyChanges(WizardForm.Handle)
  479. end;
  480. procedure InitializeWizard();
  481. var
  482. rtfstr:AnsiString;
  483. begin
  484. WizardForm.OuterNotebook.hide;
  485. WizardForm.Bevel.Hide;
  486. WizardForm.BorderStyle:=bsnone;
  487. WizardForm.Position:=poScreenCenter;
  488. WizardForm.Width:=650;
  489. WizardForm.Height:=508;
  490. WizardForm.Color:=clWhite ;
  491. NormalSetup:=true;
  492. WizardForm.OnMouseDown:=@OnWizardMouseDown
  493. CustomSetup := true;
  494. ExtractTemporaryFile(ExpandConstant('license_{language}.rtf'));
  495. ExtractTemporaryFile(ExpandConstant('edit_custom_folder_{language}.png'));
  496. ExtractTemporaryFile(ExpandConstant('bg_license_{language}.png'));
  497. ExtractTemporaryFile(ExpandConstant('bg_normal_{language}.png'));
  498. ExtractTemporaryFile(ExpandConstant('bg_custom_setup_{language}.png'));
  499. ExtractTemporaryFile(ExpandConstant('bg_finish_{language}.png'));
  500. ExtractTemporaryFile(ExpandConstant('bg_progress_{language}.png'));
  501. ExtractTemporaryFile(ExpandConstant('progress_{language}.png'));
  502. ExtractTemporaryFile(ExpandConstant('license_{language}.png'));
  503. ExtractTemporaryFile(ExpandConstant('loading_pic_{language}.png'));
  504. ExtractTemporaryFile(ExpandConstant('loading_pic1_{language}.png'));
  505. ExtractTemporaryFile(ExpandConstant('loading_pic2_{language}.png'));
  506. ExtractTemporaryFile(ExpandConstant('loading_pic3_{language}.png'));
  507. ExtractTemporaryFile(ExpandConstant('loading_pic4_{language}.png'));
  508. ExtractTemporaryFile(ExpandConstant('checkbox_{language}.png'));
  509. ExtractTemporaryFile(ExpandConstant('checkboxdeep_{language}.png'));
  510. ExtractTemporaryFile(ExpandConstant('btn_setup_{language}.png'));
  511. ExtractTemporaryFile(ExpandConstant('btn_custom_setup_{language}.png'));
  512. ExtractTemporaryFile(ExpandConstant('btn_select_folder_{language}.png'));
  513. ExtractTemporaryFile(ExpandConstant('btn_back_{language}.png'));
  514. ExtractTemporaryFile(ExpandConstant('btn_complete_{language}.png'));
  515. ExtractTemporaryFile(ExpandConstant('btn_close_{language}.png'));
  516. ExtractTemporaryFile(ExpandConstant('btn_min_{language}.png'));
  517. CloseButton:=BtnCreate(WizardForm.Handle,627,8,17,15,ExpandConstant('{tmp}\btn_close_{language}.png'),1,False)
  518. BtnSetEvent(CloseButton,BtnClickEventID,WrapBtnCallback(@OnCloseButtonClick,1));
  519. MinButton:=BtnCreate(WizardForm.Handle,607,8,17,15,ExpandConstant('{tmp}\btn_min_{language}.png'),1,False)
  520. BtnSetEvent(MinButton,BtnClickEventID,WrapBtnCallback(@OnMinButtonClick,1));
  521. SetupButton:=BtnCreate(WizardForm.Handle,225,308,199,58,ExpandConstant('{tmp}\btn_setup_{language}.png'),1,False)
  522. BtnSetEvent(SetupButton,BtnClickEventID,WrapBtnCallback(@OnSetupButtonClick,1));
  523. LicenseBackButton:=BtnCreate(WizardForm.Handle,274,380,102,42,ExpandConstant('{tmp}\btn_back_{language}.png'),1,False)
  524. BtnSetEvent(LicenseBackButton,BtnClickEventID,WrapBtnCallback(@OnLicenseBackButtonClick,1));
  525. BtnSetVisibility(LicenseBackButton,false)
  526. CustomPathEdit:= TEdit.Create(WizardForm);
  527. with CustomPathEdit do
  528. begin
  529. Parent := WizardForm;
  530. text :=WizardForm.DirEdit.text;
  531. Font.Name:='Microsoft YaHei'
  532. BorderStyle:=bsNone;
  533. SetBounds(60,383,440,24)
  534. OnChange:=@CustomPathEditChange;
  535. Color := $00FFE2D0
  536. TabStop :=false;
  537. end;
  538. CustomPathEdit.Hide;
  539. SelectFolderButton := BtnCreate(WizardForm.Handle,520,375,82,32,ExpandConstant('{tmp}\btn_select_folder_{language}.png'),1,False)
  540. BtnSetEvent(SelectFolderButton,BtnClickEventID,WrapBtnCallback(@OnSelectFolderButtonclick,1));
  541. BtnSetVisibility(SelectFolderButton,false)
  542. if ExpandConstant('{language}') = 'chinese' then
  543. begin
  544. CustomSetupButton:=BtnCreate(WizardForm.Handle,560,421,75,15,ExpandConstant('{tmp}\btn_custom_setup_{language}.png'),1,False)
  545. end
  546. else
  547. begin
  548. CustomSetupButton:=BtnCreate(WizardForm.Handle,522,421,113,15,ExpandConstant('{tmp}\btn_custom_setup_{language}.png'),1,False)
  549. end;
  550. BtnSetEvent(CustomSetupButton,BtnClickEventID,WrapBtnCallback(@OnCustomSetupButtonClick,1));
  551. ProgressBarMessageHandler:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBCallBack(@ProcessProgressBarMessage,4));
  552. AdPlayerTimer := TTimer.Create(WizardForm);
  553. with AdPlayerTimer do
  554. begin
  555. OnTimer := @OnAdPlayerTimerTimer;
  556. end;
  557. playIndex := 1;
  558. playStep := 0;
  559. waitTime := 2000;
  560. LoadStringFromFile(ExpandConstant('{tmp}\license_{language}.rtf'), rtfstr);
  561. LicenseRichEditViewer:= TRichEditViewer.Create(WizardForm);
  562. with LicenseRichEditViewer do
  563. begin
  564. Parent := WizardForm;
  565. ReadOnly:= true;
  566. ScrollBars:= ssVertical;
  567. Font.Name:='Microsoft YaHei'
  568. Color:=clWhite;
  569. BorderStyle:= bsNone;
  570. SetBounds(42,36,567,187)
  571. TabStop:=false;
  572. Height := 0;
  573. RTFText := rtfstr;
  574. UseRichEdit := true;
  575. end;
  576. ImgApplyChanges(WizardForm.Handle)
  577. end;
  578. function InitializeSetup(): Boolean;
  579. var
  580. ErrorCode: Integer;
  581. begin
  582. if IsWindowsXPOr2000 then
  583. begin
  584. MsgBox(CustomMessage('NotSupportXP'), mbError, MB_OK);
  585. end
  586. else
  587. if IsWindows7 then
  588. begin
  589. // 用是或否询问用户下载Win7SP1 补丁
  590. if MsgBox(CustomMessage('NotSupportWin7'), mbConfirmation, MB_YESNO) = IDYES then
  591. begin
  592. ShellExec('open', 'https://download.fis.plus/windows6.1-KB976932-X64.exe','', '', SW_SHOW, ewNoWait, ErrorCode);
  593. end;
  594. end
  595. else
  596. begin
  597. Result := True;
  598. end;
  599. end;
  600. procedure DeinitializeSetup();
  601. begin
  602. gdipShutdown;
  603. if ProgressBarMessageHandler<>0 then
  604. begin
  605. SetWindowLong(WizardForm.ProgressGauge.Handle,-4,ProgressBarMessageHandler);
  606. end;
  607. end;
  608. procedure CurPageChanged(CurPageID: Integer);
  609. begin
  610. WizardForm.NextButton.Visible:=false;
  611. WizardForm.CancelButton.Height:=0;
  612. WizardForm.BackButton.Height:=0;
  613. if CurPageID = wpWelcome then
  614. begin
  615. WizardForm.NextButton.OnClick(WizardForm);
  616. end;
  617. if CurPageID=wpSelectDir then
  618. begin
  619. BackgroundImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_normal_{language}.png'),0,0,650,450,true,true);
  620. if ExpandConstant('{language}') = 'chinese' then
  621. begin
  622. LicenseButton:=BtnCreate(WizardForm.Handle,100,421,108,15,ExpandConstant('{tmp}\license_{language}.png'),4,false)
  623. end
  624. else
  625. begin
  626. LicenseButton:=BtnCreate(WizardForm.Handle,100,421,167,15,ExpandConstant('{tmp}\license_{language}.png'),4,false)
  627. end;
  628. BtnSetEvent(LicenseButton,BtnClickEventID,WrapBtnCallback(@OnLicenseBackButtonClick,1));
  629. LicenseCheckBox:=BtnCreate(WizardForm.Handle,22,421,15,15,ExpandConstant('{tmp}\checkboxdeep_{language}.png'),1,true)
  630. BtnSetEvent(LicenseCheckBox,BtnClickEventID,WrapBtnCallback(@OnLicenseCheckBoxClick,1));
  631. BtnSetChecked(LicenseCheckBox,true)
  632. WizardForm.Width:=650;
  633. WizardForm.Height:=450;
  634. WizardForm.Show;
  635. end ;
  636. if CurPageID = wpInstalling then
  637. begin
  638. BtnSetPosition(LicenseCheckBox,560,421,75,15);
  639. if ExpandConstant('{language}') = 'chinese' then
  640. begin
  641. BtnSetPosition(CustomSetupButton,560,421,75,15);
  642. end
  643. else
  644. begin
  645. BtnSetPosition(CustomSetupButton,522,421,113,15);
  646. end;
  647. CustomPathEdit.Hide;
  648. BtnSetVisibility(SelectFolderButton,false)
  649. WizardForm.Height:=450
  650. CustomSetup := true
  651. BtnSetVisibility(CustomSetupButton,false);
  652. BtnSetVisibility(LicenseButton,false);
  653. BtnSetVisibility(LicenseCheckBox,false);
  654. BackgroundImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\loading_pic_{language}.png'),0,0,650,450,false,true);
  655. ProgressBarBackgroundImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_progress_{language}.png'),0,375,660,15,true,true);
  656. ProgressBarImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\progress_{language}.png'),0,375,0,0,True,True);
  657. t1:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\loading_pic1_{language}.png'),0,0,650,374,true,true); //加载图片必备的
  658. t2:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\loading_pic2_{language}.png'),0,0,650,374,true,true);
  659. t3:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\loading_pic3_{language}.png'),0,0,650,374,true,true);
  660. t4:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\loading_pic4_{language}.png'),0,0,650,374,true,true);
  661. ImgSetVisibility(t1,false) //出现动画时 第一张显示的图片 下面几张禁用的
  662. ImgSetVisibility(t2,false)
  663. ImgSetVisibility(t3,false)
  664. ImgSetVisibility(t4,false)
  665. BtnSetVisibility(SetupButton,false);
  666. AdPlayerTimer.Interval:= 10;
  667. end ;
  668. if CurPageID = wpFinished then
  669. begin
  670. AdPlayerTimer.Interval:=0
  671. ImgSetVisibility(ProgressBarBackgroundImage,false)
  672. ImgSetVisibility(ProgressBarImage,false)
  673. SetupButton:=BtnCreate(WizardForm.Handle,245,358,160,50,ExpandConstant('{tmp}\btn_complete_{language}.png'),1,False)
  674. BtnSetEvent(SetupButton,BtnClickEventID,WrapBtnCallback(@OnFinishButtonClick,1));
  675. BackgroundImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_finish_{language}.png'),0,0,650,450,false,true);
  676. BtnSetEvent(CloseButton,BtnClickEventID,WrapBtnCallback(@OnSetupButtonClick,1));
  677. end;
  678. ImgApplyChanges(WizardForm.Handle)
  679. end;
  680. function ShouldSkipPage(PageID: Integer): Boolean;
  681. begin
  682. if (PageID=wpSelectComponents) or (PageID=wpSelectTasks) then //跳过组件安装界面
  683. begin
  684. result := true;
  685. end;
  686. end;