From 2d94dc3ff6077dd51eae75ca3096da3bd0ccabb1 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sat, 24 Jun 2017 16:16:31 -0700 Subject: [PATCH] win installer improvements --- appveyor.yml | 2 +- resources/orion-installer.iss | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 32e8816..260610a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -83,7 +83,7 @@ after_build: - del %configuration%\*.h - del %configuration%\*.res - if %configuration%==release copy "resources\orion-installer.iss" orion-installer.iss - - if %configuration%==release "C:\Program Files (x86)\Inno Setup 5\iscc.exe" /F"orion-%APPVEYOR_REPO_COMMIT%-%platform%" "orion-installer.iss" + - if %configuration%==release "C:\Program Files (x86)\Inno Setup 5\iscc.exe" /DPlatform=%platform% /DAdditionalRedist="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\1033\vcredist_%platform%.exe" /F"orion-%APPVEYOR_REPO_COMMIT%-%platform%" "orion-installer.iss" artifacts: - path: orion_$(configuration)_$(platform)_snapshot_$(APPVEYOR_REPO_COMMIT).zip diff --git a/resources/orion-installer.iss b/resources/orion-installer.iss index ad82734..3c65c4c 100644 --- a/resources/orion-installer.iss +++ b/resources/orion-installer.iss @@ -3,6 +3,16 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES! +#ifndef Platform + #error Platform undefined. Pass /DPlatform={x86|x64} +#endif + +#if "x86" == Platform +#elif "x64" == Platform +#else + #error Unknown platform. Must be x86 or x64 +#endif + #define AppVersion GetFileVersion("release\orion.exe") [Setup] @@ -14,9 +24,23 @@ UninstallDisplayIcon={app}\orion.exe Compression=lzma2 SolidCompression=yes OutputDir=. +#if "x64" == Platform +ArchitecturesAllowed=x64 +ArchitecturesInstallIn64BitMode=x64 +#endif [Files] Source: "release\*"; DestDir: "{app}\bin"; Flags: ignoreversion recursesubdirs +#ifdef AdditionalRedist +Source: "{#AdditionalRedist}"; DestDir: "{app}\AdditionalRedist"; Flags: ignoreversion +#endif [Icons] Name: "{group}\Orion"; Filename: "{app}\bin\orion.exe" + +[Run] +Filename: "{app}\bin\vcredist_{#Platform}.exe"; Parameters: "/install /passive /norestart" +#ifdef AdditionalRedist +#define AdditionalRedistProper ExtractFileName(AdditionalRedist) +Filename: "{app}\AdditionalRedist\{#AdditionalRedistProper}"; Parameters: "/install /passive /norestart" +#endif