From ed61804855c2af4a3cd4effc381b6c1ee3b53fdf Mon Sep 17 00:00:00 2001 From: Roderik Ploszek Date: Sat, 24 Mar 2018 15:56:14 +0100 Subject: [PATCH] Bundle MSVC++ redistributable with the installer Installer checks for presence of msvcr100.dll library in the System32 folder (or SysWOW64 in case of 64 bit systems). If not present, it will install it (version 2010 SP1 x86). --- .appveyor.yml | 1 + scripts/create_iss.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index 6cd6eafc..9bd6044b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -42,6 +42,7 @@ test_script: - 7z a -r pysol_win_dist.7z dist\ - SET PYTHONPATH=%cd% - python3 scripts\create_iss.py + - appveyor DownloadFile https://www.microsoft.com/en-us/download/confirmation.aspx?id=8328 -FileName vcredist_x86.exe - SET PATH=%PATH%;"C:\\Program Files (x86)\\Inno Setup 5" - ISCC /Q setup.iss artifacts: diff --git a/scripts/create_iss.py b/scripts/create_iss.py index b049485a..2d32033c 100755 --- a/scripts/create_iss.py +++ b/scripts/create_iss.py @@ -55,4 +55,26 @@ for d in files_list[1:]: d = d.replace('dist\\', '') print('Source: "%s\\*"; DestDir: "{app}\\%s"' % (d, d), file=out) +print('Source: "..\\vcredist_x86.exe"; DestDir: {tmp}; \ +Flags: deleteafterinstall', file=out) +print('[Run]\n\ +Filename: {tmp}\\vcredist_x86.exe; \ +Parameters: "/passive /promptrestart /showfinalerror"; \ +StatusMsg: "Installing MS Visual C++ 2010 SP1 Redistributable Package (x86)"; \ +Check: not isVCInstalled', file=out) +print(''' +[Code] +function isVCInstalled: Boolean; +var + find: TFindRec; +begin + if FindFirst(ExpandConstant('{sys}\\msvcr100.dll'), find) then begin + Result := True; + FindClose(find); + end else begin + Result := False; + end; + end; +''', file=out) + out.close()