Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
26 changes: 21 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ jobs:
- name: Install Inno Setup silently
run: .\is.exe /verysilent /dir="C:\Program Files\InnoSetup"

- name: Create the EXE Installer
working-directory: ./utils
run: ./BuildInstaller.bat

- name: Code Signing Setup - Setup Certificate
shell: bash
run: echo "${{secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
Expand All @@ -52,7 +48,27 @@ jobs:
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
smksp_cert_sync.exe

- name: Code Signing Setup - Sign using Signtool
- name: Setup python virtual environment
run: |
python -m venv .venv
.venv\Scripts\Activate
pip install -r requirements.dev.txt

- name: Create the EXE Installer
working-directory: ./utils
run:
./BuildExecutable.bat

- name: Code Signing Setup - Sign Executable using Signtool
run: |
signtool.exe sign /sha1 ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 "./dist/LPM.exe"
signtool.exe verify /v /pa "./dist/LPM.exe"

- name: Create the EXE Installer
working-directory: ./utils
run: ./BuildInstaller.bat

- name: Code Signing Setup - Sign Installer using Signtool
run: |
signtool.exe sign /sha1 ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 "./build/LPM-Setup.exe"
signtool.exe verify /v /pa "./build/LPM-Setup.exe"
Expand Down
4 changes: 4 additions & 0 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pytest==8.3.4
pyinstaller==6.11.1

. requirements.txt
1 change: 0 additions & 1 deletion src/LPM.cmd

This file was deleted.

2 changes: 2 additions & 0 deletions utils/BuildExecutable.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cd ..
pyinstaller --onefile --clean --add-data src\version.json:. --version-file="version.txt" --icon=files\favicon.ico src\LPM.py
23 changes: 3 additions & 20 deletions utils/Setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define MyAppVersion "1.0.6"
#define MyAppPublisher "Loupe"
#define MyAppURL "https://loupe.team/"
#define MyAppExeName "LPM.cmd"
#define MyAppExeName "LPM.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
Expand Down Expand Up @@ -39,33 +39,16 @@ AlwaysRestart=yes
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "..\src\*.py"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\src\LPM.cmd"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\src\version.json"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\requirements.txt"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: "..\dist\LPM.exe"; DestDir: "{app}"; Flags: ignoreversion

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}";

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait skipifsilent
Filename: "{cmd}"; Parameters: "/C pip install -r ""{app}\requirements.txt"""; Description: "Installing Python dependencies..."; StatusMsg: "Installing dependencies..."; Check: PythonAndPipExist()

[Code]

{ ///////////////////////////////////////////////////////////////////// }
function PythonAndPipExist(): Boolean;
var
ErrorCode: Integer;
begin
if Exec('python', '--version', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) and
Exec('pip', '--version', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
Result := True
else
Result := False;
end;

{ ///////////////////////////////////////////////////////////////////// }
function GetUninstallString(): String;
var
Expand Down Expand Up @@ -123,4 +106,4 @@ begin
UnInstallOldVersion();
end;
end;
end;
end;
33 changes: 33 additions & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# UTF-8
VSVersionInfo(
ffi=FixedFileInfo(
filevers=(1, 0, 6, 1),
prodvers=(1, 0, 6, 1),
mask=0x3f,
flags=0x0,
OS=0x4,
fileType=0x1,
subtype=0x0,
date=(0, 0)
),
kids=[
StringFileInfo(
[
StringTable(
u'040904B0',
[
StringStruct(u'CompanyName', u'Loupe'),
StringStruct(u'FileDescription', u'LPM is the Loupe Package Manager voor B&R Automation Studio'),
StringStruct(u'FileVersion', u'1.0.6'),
StringStruct(u'InternalName', u'LPM'),
StringStruct(u'LegalCopyright', u'Copyright (C) 2023 Loupe, All rights reserved.'),
StringStruct(u'ProductName', u'LPM'),
StringStruct(u'ProductVersion', u'1.0.0'),
StringStruct(u'ApplicationName', u'LPM.exe')
]
)
]
),
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
]
)