Skip to content

Commit

Permalink
Adds Windows installer. Closes #637 (#642)
Browse files Browse the repository at this point in the history
* Adds Windows installer

* Fixes working directory for Build Installer step in create-release.yml

* Fixes working directory for Build Installer step in create-release.yml

* Fixes working directory for Build Installer step in create-release.yml

* Adds Windows installer and updates create-release.yml

* Updates upload-artifact action to v4 in create-release.yml

* Updates installer file name and version in install.iss

* Updates OutputDir in install.iss

* Updates path for dev-proxy-installer in create-release.yml

* Adds installer icon to Windows build

* Updates installer file name and version in install.iss

* Updates installer file name and version in install.iss

---------

Co-authored-by: Waldek Mastykarz <[email protected]>
  • Loading branch information
garrytrinder and waldekmastykarz authored Apr 12, 2024
1 parent e90e2ef commit 204773b
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 17 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,22 @@ jobs:
with:
name: binaries-dev-proxy-abstractions-${{ github.ref_name }}
path: ./dev-proxy-abstractions-${{ github.ref_name }}.zip
- name: Add install file
if: matrix.architecture == 'win-x64' || matrix.architecture == 'win-x86'
run: cp ./install.iss ./${{ env.release }}
- name: Add installer icon
if: matrix.architecture == 'win-x64' || matrix.architecture == 'win-x86'
run: cp ./media/icon.ico ./${{ env.release }}
- name: Build Installer
if: matrix.architecture == 'win-x64' || matrix.architecture == 'win-x86'
run: ISCC.exe install.iss /F"dev-proxy-installer-${{ matrix.architecture }}-${{ github.ref_name }}"
working-directory: ./${{ env.release }}
- name: Upload Installer
if: matrix.architecture == 'win-x64' || matrix.architecture == 'win-x86'
uses: actions/upload-artifact@v4
with:
name: installer-dev-proxy-${{ github.ref_name }}-${{ matrix.architecture }}
path: ./${{ env.release }}/dev-proxy-installer-${{ matrix.architecture }}-${{ github.ref_name }}.exe
create_release:
name: Create Release
needs: [publish_binaries]
Expand All @@ -90,3 +106,4 @@ jobs:
with:
args: |
output/binaries-*/*.zip
output/installer-*/*.exe
34 changes: 17 additions & 17 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License
MIT License

Copyright (c) 2022 Microsoft Graph
Copyright (c) Microsoft Corporation.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
72 changes: 72 additions & 0 deletions install.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Dev Proxy"
#define MyAppSetupExeName "dev-proxy-installer-win-x64-0.17.0"
#define MyAppVersion "0.17.0"
#define MyAppPublisher "Microsoft"
#define MyAppURL "https://aka.ms/devproxy"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{4448FDE7-D519-4009-AFE2-0C5D0AA9C3D2}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
AppVerName={#MyAppName} v{#MyAppVersion}
UninstallDisplayIcon={app}\icon.ico
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=..\LICENSE
; Remove the following line to run in administrative install mode (install for all users.)
PrivilegesRequired=lowest
OutputBaseFilename={#MyAppSetupExeName}
Compression=lzma
SolidCompression=yes
WizardStyle=modern
OutputDir=.

[Registry]
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Flags: preservestringtype

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: ".\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.iss"

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[UninstallDelete]
Type:files;Name:"{app}\rootCert.pfx"

[Code]
function UpdatePath(Param: string): string;
var
OrigPath: string;
begin
// Get original PATH value
if not RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath) then
OrigPath := '';
// If the path is already there, do nothing
if Pos(';' + ExpandConstant('{app}') + ';', ';' + OrigPath + ';') > 0 then
Result := OrigPath
else
// Otherwise, add it
Result := OrigPath + ';' + ExpandConstant('{app}');
end;
procedure DeinitializeSetup();
var
OrigPath: string;
begin
OrigPath := UpdatePath('');
// Set the updated path during installation
RegWriteStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath);
end;
Binary file added media/icon.ico
Binary file not shown.

0 comments on commit 204773b

Please sign in to comment.