ClientSetupScript.iss 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. ; -- vCloudSetup.iss --
  2. ;
  3. ; This script will extract the installer files to temp folder and run the setup file which writen in C#
  4. #define SetupAppName "vCloud Setup package"
  5. #define SetupAppPublisher "VINNO Technology (Suzhou) Co., Ltd ."
  6. #define CopyRight "Copyright ©2018 VINNO Corporation. All rights reserved."
  7. #define SetupAppExeName "vCloudSetup.exe"
  8. ;#define SetupAppVersion "1.0.0.0"
  9. ;#define ProjectFolder "D:\Projects\vCloud_1.2_LiveTalking"
  10. [Setup]
  11. AppVersion={#SetupAppVersion}
  12. AppName={#SetupAppName}
  13. DefaultDirName="%APPDATA%"
  14. DefaultGroupName=
  15. Compression=lzma
  16. SolidCompression=yes
  17. PrivilegesRequired=admin
  18. VersionInfoDescription={#SetupAppName}
  19. VersionInfoProductName={#SetupAppName}
  20. VersionInfoVersion={#SetupAppVersion}
  21. VersionInfoCompany={#SetupAppPublisher}
  22. VersionInfoCopyright={#CopyRight}
  23. SetupIconFile={#ProjectFolder}\Build\ClientIcon.ico
  24. OutputDir={#ProjectFolder}\Distribution\
  25. OutputBaseFilename=ClientSetup_Release_{#SetupAppVersion}
  26. LanguageDetectionMethod=uilanguage
  27. ShowLanguageDialog=no
  28. [Files]
  29. Source: "{#ProjectFolder}\Distribution\Client\Windows\ClientInstallerNFX35.exe"; Flags: dontcopy noencryption
  30. Source: "{#ProjectFolder}\Distribution\Client\Windows\ClientInstallerNFX40.exe"; Flags: dontcopy noencryption
  31. Source: "{#ProjectFolder}\Distribution\Client\Windows\DotNetZip.dll"; Flags: dontcopy noencryption
  32. [Languages]
  33. Name: "english"; MessagesFile: "compiler:Default.isl"
  34. Name: "chinese"; MessagesFile: "{#ProjectFolder}\Build\Chinese.isl"
  35. [CustomMessages]
  36. english.NotSupportXP=Windows XP and lower version are not supported.
  37. chinese.NotSupportXP=杏聆荟软件无法在Windows XP安装。
  38. [Code]
  39. function IsWindowsXPOr2000: Boolean;
  40. var
  41. Version: TWindowsVersion;
  42. begin
  43. GetWindowsVersionEx(Version);
  44. if Version.Major = 5 then
  45. Result := True
  46. else
  47. Result := False;
  48. end;
  49. function IsWindows7:Boolean;
  50. var
  51. Version: TWindowsVersion;
  52. begin
  53. GetWindowsVersionEx(Version);
  54. if (Version.Major >=6) and (Version.Major < 10) then
  55. Result := True
  56. else
  57. Result := False;
  58. end;
  59. function IsWindows10:Boolean;
  60. var
  61. Version: TWindowsVersion;
  62. begin
  63. GetWindowsVersionEx(Version);
  64. if Version.Major >=10 then
  65. Result := True
  66. else
  67. Result := False;
  68. end;
  69. function InitializeSetup(): Boolean;
  70. var
  71. LoadingExeFile:String;
  72. SetupExeFile: String;
  73. NewSetupExeFile:String;
  74. SetupDllFile: String;
  75. NewSetupDllFile:String;
  76. SetupFileName:String;
  77. ErrorCode: Integer;
  78. begin
  79. if IsWindowsXPOr2000 then
  80. begin
  81. MsgBox('{cm:NotSupportXP}', mbError, MB_OK);
  82. end
  83. else
  84. begin
  85. ExtractTemporaryFile('ClientInstallerNFX35.exe');
  86. ExtractTemporaryFile('ClientInstallerNFX40.exe');
  87. ExtractTemporaryFile('DotNetZip.dll');
  88. SetupDllFile := ExpandConstant('{tmp}\DotNetZip.dll');
  89. NewSetupDllFile := GetTempDir + '\' + ExtractFileName(SetupDllFile);
  90. FileCopy(SetupDllFile, NewSetupDllFile,false);
  91. if IsWindows7 then
  92. begin
  93. SetupExeFile := ExpandConstant('{tmp}\ClientInstallerNFX35.exe');
  94. end
  95. else
  96. begin
  97. SetupExeFile := ExpandConstant('{tmp}\ClientInstallerNFX40.exe');
  98. end;
  99. NewSetupExeFile := GenerateUniqueName(GetTempDir, '.exe');
  100. FileCopy(SetupExeFile, NewSetupExeFile,false);
  101. ShellExec('', NewSetupExeFile, '/source ' + ExpandConstant('{srcexe}'), '', SW_SHOW, ewNoWait, ErrorCode);
  102. end;
  103. Result:= false;
  104. end;