AgentSetupScript_Full.iss 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #define SetupAppName "Agent assistant"
  2. #define SetupAppPublisher "VINNO Technology (Suzhou) Co., Ltd ."
  3. #define SetupAppURL "http://www.ichaorenhui.com"
  4. #define SetupAppExeName "vCloud.Agent.exe"
  5. #define CopyRight "Copyright ©2015 VINNO Corporation. All rights reserved."
  6. ;#define SetupAppVersion "1.0.0.0"
  7. ;#define ProjectFolder "E:\NewCode\vCloudRefactor"
  8. [Setup]
  9. ; NOTE: The value of AppId uniquely identifies this application.
  10. ; Do not use the same AppId value in installers for other applications.
  11. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
  12. AppId={{75B8660D-F5CF-80B5-B8EA-96676A22AA79}
  13. AppName={cm:MyAppName}
  14. AppVersion={#SetupAppVersion}
  15. AppVerName={cm:MyAppName} {#SetupAppVersion}
  16. AppPublisher={#SetupAppPublisher}
  17. AppPublisherURL={#SetupAppURL}
  18. AppSupportURL={#SetupAppURL}
  19. AppUpdatesURL={#SetupAppURL}
  20. DefaultDirName={pf}\{cm:MyAppName}
  21. DefaultGroupName={cm:MyAppName}
  22. OutputDir={#ProjectFolder}\Distribution
  23. OutputBaseFilename=AgentSetupFull_{#SetupAppVersion}
  24. SetupIconFile={#ProjectFolder}\Build\Agent.ico
  25. WizardSmallImageFile={#ProjectFolder}\Build\Agent_Small.bmp
  26. ;WizardImageFile={#ProjectFolder}\Build\WizardSetup.bmp
  27. ArchitecturesInstallIn64BitMode=x64
  28. Compression=lzma
  29. SolidCompression=yes
  30. PrivilegesRequired=admin
  31. UninstallDisplayIcon={app}\{#SetupAppExeName}
  32. UninstallDisplayName={cm:MyAppName}
  33. VersionInfoVersion={#SetupAppVersion}
  34. VersionInfoCompany={#SetupAppPublisher}
  35. VersionInfoCopyright={#CopyRight}
  36. VersionInfoDescription={#SetupAppName}
  37. VersionInfoProductName={#SetupAppName}
  38. DisableWelcomePage=no
  39. [Languages]
  40. Name: "english"; MessagesFile: "compiler:Default.isl"
  41. Name: "chinese"; MessagesFile: "{#ProjectFolder}\Build\Chinese.isl"
  42. [CustomMessages]
  43. english.MyAppName=Flyinsono Agent assistant
  44. chinese.MyAppName=杏聆荟代理助手
  45. english.InstallFramework=Install Microsoft .Net Framework
  46. chinese.InstallFramework=安装 Microsoft .Net Framework
  47. english.InstallingFramework=Installing Microsoft .Net Framework...
  48. chinese.InstallingFramework=正在安装 Microsoft .Net Framework...
  49. [Tasks]
  50. Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
  51. [Files]
  52. Source: "{#ProjectFolder}\Distribution\Agent\Accord.dll"; DestDir: "{app}"; Flags: ignoreversion
  53. Source: "{#ProjectFolder}\Distribution\Agent\Accord.Video.dll"; DestDir: "{app}"; Flags: ignoreversion
  54. Source: "{#ProjectFolder}\Distribution\Agent\Accord.Video.DirectShow.dll"; DestDir: "{app}"; Flags: ignoreversion
  55. Source: "{#ProjectFolder}\Distribution\Agent\Dicom.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
  56. Source: "{#ProjectFolder}\Distribution\Agent\Dicom.Native.dll"; DestDir: "{app}"; Flags: ignoreversion
  57. Source: "{#ProjectFolder}\Distribution\Agent\Dicom.Native64.dll"; DestDir: "{app}"; Flags: ignoreversion
  58. Source: "{#ProjectFolder}\Distribution\Agent\System.Windows.Interactivity.dll"; DestDir: "{app}"; Flags: ignoreversion
  59. Source: "{#ProjectFolder}\Distribution\Agent\Vinno.vCloud.Terminal.dll"; DestDir: "{app}"; Flags: ignoreversion
  60. Source: "{#ProjectFolder}\Distribution\Agent\Vinno.vCloud.Base.dll"; DestDir: "{app}"; Flags: ignoreversion
  61. Source: "{#ProjectFolder}\Distribution\Agent\vCloud.Agent.exe"; DestDir: "{app}"; Flags: ignoreversion
  62. Source: "{#ProjectFolder}\Distribution\Agent\Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignoreversion
  63. Source: "{#ProjectFolder}\Distribution\Agent\Settings\Agent\*"; DestDir: "{app}\Settings\Agent"; Flags: ignoreversion recursesubdirs createallsubdirs
  64. Source: "{#ProjectFolder}\Build\NDP461.exe"; DestDir: "{app}"; Flags: ignoreversion
  65. Source: "{#ProjectFolder}\Distribution\Agent\vCloudPusher\*"; DestDir: "{app}\vCloudPusher"; Flags: ignoreversion
  66. Source: "{#ProjectFolder}\Distribution\Agent\vCloudPusher\x86\*"; DestDir: "{app}\vCloudPusher\x86"; Flags: ignoreversion recursesubdirs createallsubdirs
  67. Source: "{#ProjectFolder}\Distribution\Agent\vCloudPusher\x64\*"; DestDir: "{app}\vCloudPusher\x64"; Flags: ignoreversion recursesubdirs createallsubdirs
  68. Source: "{#ProjectFolder}\Distribution\Agent\UploadVidTags.conf"; DestDir: "{app}"; Flags: ignoreversion
  69. [Icons]
  70. Name: "{group}\{cm:MyAppName}"; Filename: "{app}\{#SetupAppExeName}"
  71. Name: "{commondesktop}\{cm:MyAppName}"; Filename: "{app}\{#SetupAppExeName}"; Tasks: desktopicon
  72. [Run]
  73. Filename: "{app}\NDP461.exe";Description:"{cm:InstallFramework}"; StatusMsg:"{cm:InstallingFramework}"; Flags: runascurrentuser; Check:not IsDotNetDetected
  74. Filename: "{app}\{#SetupAppExeName}"; Description: "{cm:LaunchProgram,{cm:MyAppName}}"; Flags:runascurrentuser nowait postinstall skipifsilent
  75. Filename: "{app}\{#SetupAppExeName}"; Description: "{cm:LaunchProgram,{cm:MyAppName}}"; Flags:runascurrentuser nowait; Check:WizardSilent
  76. [Code]
  77. function IsDotNetDetected(): boolean;
  78. var
  79. key: string;
  80. install, serviceCount : cardinal;
  81. success: boolean;
  82. begin
  83. // installation key group for all .NET versions
  84. key := 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full';
  85. success := RegQueryDWordValue(HKEY_LOCAL_MACHINE, key, 'Install', install);
  86. success := success and RegQueryDWordValue(HKEY_LOCAL_MACHINE, key, 'Servicing', serviceCount);
  87. result := success and (serviceCount >= 0) and (install = 1);
  88. end;
  89. procedure KillAgent();
  90. var
  91. ResultCode: Integer;
  92. ExePath: String;
  93. begin
  94. begin
  95. Exec('TASKKILL', '/IM vCloud.Agent.exe /F', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
  96. Exec('TASKKILL', '/IM PushApp.exe /F', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
  97. end;
  98. end;
  99. procedure CurStepChanged(CurStep: TSetupStep);
  100. begin
  101. if CurStep = ssinstall then
  102. begin
  103. KillAgent();
  104. end;
  105. end;