flyinsono_Lab_Client.iss 27 KB

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