Include Visual C++ redistributable inside Windows Installer

This commit is contained in:
Federico Terzi 2019-09-30 22:40:19 +02:00
parent a5347cfffe
commit a56de80ef8
5 changed files with 15 additions and 6 deletions

2
Cargo.lock generated
View File

@ -329,7 +329,7 @@ dependencies = [
[[package]]
name = "espanso"
version = "0.2.1"
version = "0.2.2"
dependencies = [
"backtrace 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -1,6 +1,6 @@
[package]
name = "espanso"
version = "0.2.1"
version = "0.2.2"
authors = ["Federico Terzi <federicoterzi96@gmail.com>"]
license = "GPL-3.0"
description = "Cross-platform Text Expander written in Rust"

View File

@ -6,6 +6,7 @@ import hashlib
import click
import shutil
import toml
import urllib.request
from dataclasses import dataclass
PACKAGER_TARGET_DIR = "target/packager"
@ -75,6 +76,10 @@ def build_windows(package_info):
TARGET_DIR = os.path.join(PACKAGER_TARGET_DIR, "win")
os.makedirs(TARGET_DIR, exist_ok=True)
print("Downloading Visual C++ redistributable")
vc_redist_file = os.path.join(TARGET_DIR, "vc_redist.x64.exe")
urllib.request.urlretrieve("https://aka.ms/vs/16/release/vc_redist.x64.exe", vc_redist_file)
INSTALLER_NAME = f"espanso-win-installer"
# Inno setup

View File

@ -170,7 +170,7 @@ var
begin
taskname := ModPathName;
if CurStep = ssPostInstall then
if IsTaskSelected(taskname) then
if WizardIsTaskSelected(taskname) then
ModPath();
end;

View File

@ -37,11 +37,12 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "{{{executable_path}}}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{{{app_icon}}}"; DestDir: "{app}"; Flags: ignoreversion
Source: "vc_redist.x64.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\icon.ico"
Name: "{userstartup}\espanso"; Filename: "{app}\espanso.exe"; Tasks:StartMenuEntry;
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "start"; IconFilename: "{app}\icon.ico"
Name: "{userstartup}\espanso"; Filename: "{app}\espanso.exe"; Parameters: "start"; Tasks:StartMenuEntry;
[Tasks]
Name: modifypath; Description: Add espanso to PATH ( recommended );
@ -60,7 +61,10 @@ end;
#include "modpath.iss"
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Filename: {tmp}\vc_redist.x64.exe; \
Parameters: "/install /quiet"; \
StatusMsg: "Installing Visual C++ 2019 Redistributable";
Filename: "{app}\{#MyAppExeName}"; Parameters: "start"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[UninstallRun]
Filename: "{cmd}"; Parameters: "/C ""taskkill /im espanso.exe /f /t"