Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow action to generate GUIX Studio installer. #87

Merged
merged 9 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/studio_demo_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
submodules: true

- name: Build
run: scripts\build_studio_demo.cmd
run: scripts\build_guix_studio.cmd
ting-ms marked this conversation as resolved.
Show resolved Hide resolved

- name: Test
run: scripts\test_studio_demo.cmd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/studio_demo_test_compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
submodules: true

- name: Build
run: scripts\build_studio_demo_compile.cmd
run: scripts\build_guix.cmd

- name: Test
run: scripts\test_studio_demo_compile.cmd
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/studio_installer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This is a basic workflow that is manually triggered

name: GUIX Studio Installer

# Controls when the action will run.
on:
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "linux_job"
generate_studio_installer:
permissions:
contents: read
issues: read
checks: write
pull-requests: write

# The type of runner that the job will run on
runs-on: windows-2019

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
submodules: true

- name: Install Inno Setup
run: scripts\run-pwsh.cmd scripts\install_inno_setup.ps1

- name: Build GUIX Studio
run: scripts\build_guix_studio.cmd

- name: Download VC++ Redistributable
run: scripts\download_vc_redist.cmd

- name: Generate installer
run: scripts\generate_studio_installer.cmd

- name: Upload installer
uses: actions/[email protected]
with:
name: guix_studio_installer
path: guix_studio\installer\output\*.exe
17 changes: 17 additions & 0 deletions guix_studio/installer/Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

To generate GUIX Studio installer, follow these steps:

1) Install Inno Setup from the following link:

http://www.jrsoftware.org/isinfo.php

2) Build GUIX Studio executable:
Execute script "build_guix_studio.cmd" from scripts folder.

3) Download Microsoft Visual C++ Redistributable:
Execute script "download_vc_redist.cmd" from scripts folder to download the Microsoft Visual C++ Redistributable package.
This package is essential for installing Microsoft C and C++(MSVC) runtime libraries.

4)Run the Inno Setup compiler:
Launch the Inno Setup compiler and open /GUIX/installer/guix_installer.iss.
Click the compiler button. When the compiler runs cleanly, the installer is generated in output folder.
65 changes: 65 additions & 0 deletions guix_studio/installer/guix_installer_release.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[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={{1D4932BC-ACD4-4292-9530-92C8BE2E58CF}
AppName= GUIX Studio
AppVersion=6.3.0.1
;AppPublisher=
AppPublisherURL=https://azure.com/rtos
AppSupportURL=https://azure.com/rtos
AppUpdatesURL=https://azure.com/rtos
DefaultDirName={sd}\Azure_RTOS\GUIX_Studio_6.3
DefaultGroupName=Azure RTOS
CloseApplications=no
;LicenseFile=
OutputBaseFilename=guix_studio_setup_version_6.3.0.1
SetupIconFile=graphics\guix_1616icon.ico
Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
UsePreviousAppDir=no
UsePreviousGroup=no
;SignedUninstaller=yes
;SignTool=

SourceDir=..\
OutputDir=installer\output

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

[CustomMessages]
AskAssociate=Associate the GUIX Studio application with the .gxp file extension

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce
Name: "associate"; Description: "{cm:AskAssociate}"; GroupDescription: "Other tasks"; Flags: checkedonce

[Files]
Source: "installer\vc_redist.x86.exe"; DestDir: "{tmp}"; Flags: nocompression createallsubdirs recursesubdirs deleteafterinstall
Source: "build\vs_2019\Release\guix_studio.exe"; DestDir: "{app}\studio"; DestName: "GUIX_Studio.exe"; Flags: ignoreversion

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

[Icons]
Name: "{group}\GUIX Studio 6.2\GUIX Studio"; Filename: "{app}\studio\GUIX_Studio.exe"
ting-ms marked this conversation as resolved.
Show resolved Hide resolved
Name: "{group}\GUIX Studio 6.2\GUIX Studio User's Guide"; Filename: "https://aka.ms/azrtos-guix-studio-user-guide"
Name: "{group}\GUIX Studio 6.2\GUIX User's Guide"; Filename: "https://aka.ms/azrtos-guix-user-guide"
Name: "{group}\GUIX Studio 6.2\{cm:UninstallProgram,GUIX Studio}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\GUIX Studio 6.3.0.1"; Filename: "{app}\studio\GUIX_Studio.exe"; Tasks: desktopicon

[Registry]
Root: HKCR; Subkey: ".gxp"; ValueType: string; ValueName: ""; ValueData: "GUIX_Studio_Project"; Flags: uninsdeletevalue; Tasks: associate
Root: HKCR; Subkey: "GUIX_Studio_Project"; ValueType: string; ValueName: ""; ValueData: "GUIX Studio Project"; Flags: uninsdeletekey; Tasks: associate
Root: HKCR; Subkey: "GUIX_Studio_Project\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\studio\GUIX_Studio.exe,0"; Tasks: associate
Root: HKCR; Subkey: "GUIX_Studio_Project\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\studio\GUIX_Studio.exe"" ""%1"""; Tasks: associate

Root: HKLM; Subkey: "Software\Microsoft\Azure_RTOS\GUIX\InstallDir"; ValueType: string; ValueName: ""; ValueData: "{app}";

[Run]
Filename: "{tmp}\vc_redist.x86.exe"; StatusMsg: "Installing Visual C++ 2015-2019 Redistributable(x86)"; Parameters:"/passive"

File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions scripts/download_vc_redist.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rem Save working directory so that we can restore it back after building everything. This will make developers happy and then
rem switch to the folder this script resides in. Don't assume absolute paths because on the build host and on the dev host the locations may be different.
pushd "%~dp0"

"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File download_vc_redist.ps1

exit /B %ERRORLEVEL%
3 changes: 3 additions & 0 deletions scripts/download_vc_redist.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd ../guix_studio/installer
Invoke-WebRequest https://aka.ms/vs/16/release/vc_redist.x86.exe -O vc_redist.x86.exe
dir
10 changes: 10 additions & 0 deletions scripts/generate_studio_installer.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rem Save working directory so that we can restore it back after building everything. This will make developers happy and then
rem switch to the folder this script resides in. Don't assume absolute paths because on the build host and on the dev host the locations may be different.
pushd "%~dp0"

cd ..\guix_studio\installer

rem generate studio installer
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /Q "guix_installer_release.iss"

exit /B %ERRORLEVEL%
30 changes: 30 additions & 0 deletions scripts/install_inno_setup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
$ErrorActionPreference = "Stop"

if (Test-Path "$PSScriptRoot\win-installer-helper.psm1")
{
Import-Module "$PSScriptRoot\win-installer-helper.psm1"
}
elseif (Test-Path "C:\win-installer-helper.psm1")
{
Import-Module "C:\win-installer-helper.psm1"
}

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Start-Setup

try {


Get-File -Url "http://www.jrsoftware.org/download.php/is.exe" -fileName "innosetup-6.0.3.exe"
Install-FromExe -Path "C:\Downloads\innosetup-6.0.3.exe" -Arguments "/VERYSILENT /SUPPRESSMSGBOXES"
}
catch
{
$_.Exception | Format-List
exit -1
}
finally
{
Stop-Setup
}
5 changes: 5 additions & 0 deletions scripts/run-pwsh.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off
setlocal EnableDelayedExpansion
setlocal EnableExtensions
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File "%1"
exit /B %ERRORLEVEL%
Loading