From 7018d3b862682f997fd221acf4ee371b8360dda3 Mon Sep 17 00:00:00 2001 From: Egor Bespalov Date: Mon, 4 Jul 2022 10:45:44 +0300 Subject: [PATCH] Add vcredist --- exe/common.iss | 3 +++ exe/products.iss | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/exe/common.iss b/exe/common.iss index 6db73abf..0e5b6eed 100644 --- a/exe/common.iss +++ b/exe/common.iss @@ -331,6 +331,9 @@ Source: ..\common\documentserver\nginx\includes\*.conf; DestDir: {#NGINX_SRV_DI Source: ..\common\documentserver\nginx\*.tmpl; DestDir: {#NGINX_SRV_DIR}\conf; Flags: ignoreversion recursesubdirs; Components: Program Source: ..\common\documentserver\nginx\ds.conf; DestDir: {#NGINX_SRV_DIR}\conf; Flags: onlyifdoesntexist uninsneveruninstall; Components: Program Source: scripts\connectionRabbit.py; DestDir: "{app}"; Flags: ignoreversion; Components: Program +Source: data\vcredist\vcredist_2022_x64.exe; DestDir: {app}; Flags: deleteafterinstall; \ + AfterInstall: installVCRedist(ExpandConstant('{app}\vcredist_2022_x64.exe'), ExpandConstant('{cm:InstallAdditionalComponents}')); \ + Check: not checkVCRedist2022; [Dirs] Name: "{app}\server\App_Data"; Permissions: service-modify diff --git a/exe/products.iss b/exe/products.iss index 71129a89..76f51b32 100644 --- a/exe/products.iss +++ b/exe/products.iss @@ -141,4 +141,26 @@ begin end; end; +function checkVCRedist2022(): Boolean; +var + upgradecode: String; +begin + if Is64BitInstallMode then + upgradecode := '{36F68A90-239C-34DF-B58C-64B30153CE35}' //x64 + else + upgradecode := '{65E5BD06-6392-3027-8C26-853107D3CF1A}'; //x86 + Result := msiproductupgrade(upgradecode, '14.30'); +end; + +procedure installVCRedist(FileName, LabelCaption: String); +var + Params: String; + ErrorCode: Integer; +begin + if Length(LabelCaption) > 0 then WizardForm.StatusLabel.Caption := LabelCaption; + Params := '/quiet /norestart'; + ShellExec('', FileName, Params, '', SW_SHOW, ewWaitUntilTerminated, ErrorCode); + WizardForm.StatusLabel.Caption := SetupMessage(msgStatusExtractFiles); +end; + [Setup]