Skip to content

Commit

Permalink
fix installator and windows install script
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor00f committed Nov 11, 2024
1 parent 23d7d80 commit 4147406
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ jobs:
- name: Run script
run: ${{ github.workspace }}/install.bat

- name: Add toolchain to path
run: echo "C:\MinGW\msys\1.0\home\autobuild\tools\win32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Test run
run: |
kos32-g++ -v
kos32-gcc -v
shell: cmd

#Test Windows Installer
build-Installer:
runs-on: windows-latest
Expand Down
34 changes: 33 additions & 1 deletion installator.iss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}\releases
AppReadmeFile=.\README.md
DefaultDirName=C:\MinGW\msys\1.0\home\autobuild\tools
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
Expand Down Expand Up @@ -57,8 +58,39 @@ Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"


[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \
ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\win32\bin"; \
Check: NeedsAddPath('{app}\win32\bin')

[Files]
Source: ".\install.bat"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Run]
Filename: "{app}\install.bat"; description: "install script"; StatusMsg: "Installing toolchain"; Parameters: "{app}"; Flags: runhidden logoutput

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

[UninstallDelete]
Type: files; Name: "{app}\*"

[Code]
function NeedsAddPath(Param: string): boolean;
var
OrigPath: string;
begin
if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'Path', OrigPath)
then begin
Result := True;
exit;
end;
{ look for the path with leading and trailing semicolon }
{ Pos() returns 0 if not found }
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
end;

0 comments on commit 4147406

Please sign in to comment.