Skip to content

Commit d43faa4

Browse files
authored
Adds Windows beta installer (#652)
* Fixes installer build for non-beta releases * Fixes installer build for non-beta releases * Fixes installer build for non-beta releases
1 parent 228a192 commit d43faa4

File tree

2 files changed

+89
-7
lines changed

2 files changed

+89
-7
lines changed

.github/workflows/create-release.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,28 @@ jobs:
6666
with:
6767
name: binaries-dev-proxy-abstractions-${{ github.ref_name }}
6868
path: ./dev-proxy-abstractions-${{ github.ref_name }}.zip
69-
- name: Add install file
70-
if: matrix.architecture == 'win-x64' || matrix.architecture == 'win-x86'
71-
run: cp ./install.iss ./${{ env.release }}
7269
- name: Add installer icon
73-
if: matrix.architecture == 'win-x64' || matrix.architecture == 'win-x86'
70+
if: contains(matrix.architecture, 'win-')
7471
run: cp ./media/icon.ico ./${{ env.release }}
72+
- name: Set installer file name
73+
id: installer
74+
if: contains(matrix.architecture, 'win-')
75+
run: |
76+
if contains(github.ref_name, 'beta')
77+
then
78+
echo "::set-output name=filename::install-beta.iss"
79+
else
80+
echo "::set-output name=filename::install.iss"
81+
fi
82+
- name: Add install file
83+
if: contains(matrix.architecture, 'win-')
84+
run: cp ./${{ steps.installer.outputs.filename }} ./${{ env.release }}
7585
- name: Build Installer
76-
if: matrix.architecture == 'win-x64' || matrix.architecture == 'win-x86'
77-
run: ISCC.exe install.iss /F"dev-proxy-installer-${{ matrix.architecture }}-${{ github.ref_name }}"
86+
if: contains(matrix.architecture, 'win-')
87+
run: ISCC.exe ${{ steps.installer.outputs.filename }} /F"dev-proxy-installer-${{ matrix.architecture }}-${{ github.ref_name }}"
7888
working-directory: ./${{ env.release }}
7989
- name: Upload Installer
80-
if: matrix.architecture == 'win-x64' || matrix.architecture == 'win-x86'
90+
if: contains(matrix.architecture, 'win-')
8191
uses: actions/upload-artifact@v4
8292
with:
8393
name: installer-dev-proxy-${{ github.ref_name }}-${{ matrix.architecture }}

install-beta.iss

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
; Script generated by the Inno Setup Script Wizard.
2+
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+
#define MyAppName "Dev Proxy Beta"
5+
#define MyAppSetupExeName "dev-proxy-installer-win-x64-0.17.0-beta.1"
6+
#define MyAppVersion "0.17.0-beta.1"
7+
#define MyAppPublisher "Microsoft"
8+
#define MyAppURL "https://aka.ms/devproxy"
9+
10+
[Setup]
11+
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
12+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
13+
AppId={{4448FDE7-D519-4009-AFE2-0C5D0AA9C3D2}
14+
AppName={#MyAppName}
15+
AppVersion={#MyAppVersion}
16+
AppPublisher={#MyAppPublisher}
17+
AppPublisherURL={#MyAppURL}
18+
AppSupportURL={#MyAppURL}
19+
AppUpdatesURL={#MyAppURL}
20+
AppVerName={#MyAppName} v{#MyAppVersion}
21+
UninstallDisplayIcon={app}\icon.ico
22+
DefaultDirName={autopf}\{#MyAppName}
23+
DefaultGroupName={#MyAppName}
24+
DisableProgramGroupPage=yes
25+
LicenseFile=..\LICENSE
26+
; Remove the following line to run in administrative install mode (install for all users.)
27+
PrivilegesRequired=lowest
28+
OutputBaseFilename={#MyAppSetupExeName}
29+
Compression=lzma
30+
SolidCompression=yes
31+
WizardStyle=modern
32+
OutputDir=.
33+
34+
[Registry]
35+
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Flags: preservestringtype
36+
37+
[Languages]
38+
Name: "english"; MessagesFile: "compiler:Default.isl"
39+
40+
[Files]
41+
Source: ".\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.iss"
42+
43+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
44+
45+
[UninstallDelete]
46+
Type:files;Name:"{app}\rootCert.pfx"
47+
48+
[Code]
49+
function UpdatePath(Param: string): string;
50+
var
51+
OrigPath: string;
52+
begin
53+
// Get original PATH value
54+
if not RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath) then
55+
OrigPath := '';
56+
57+
// If the path is already there, do nothing
58+
if Pos(';' + ExpandConstant('{app}') + ';', ';' + OrigPath + ';') > 0 then
59+
Result := OrigPath
60+
else
61+
// Otherwise, add it
62+
Result := OrigPath + ';' + ExpandConstant('{app}');
63+
end;
64+
65+
procedure DeinitializeSetup();
66+
var
67+
OrigPath: string;
68+
begin
69+
OrigPath := UpdatePath('');
70+
// Set the updated path during installation
71+
RegWriteStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath);
72+
end;

0 commit comments

Comments
 (0)