fix installator and windows install script

This commit is contained in:
Егор 2024-11-11 16:09:41 +05:00
parent 23d7d8064d
commit 41474060b3
2 changed files with 33 additions and 10 deletions

View File

@ -40,15 +40,6 @@ jobs:
- name: Run script - name: Run script
run: ${{ github.workspace }}/install.bat 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 #Test Windows Installer
build-Installer: build-Installer:
runs-on: windows-latest runs-on: windows-latest

View File

@ -16,7 +16,8 @@ AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher} AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL} AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL} AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL} AppUpdatesURL={#MyAppURL}\releases
AppReadmeFile=.\README.md
DefaultDirName=C:\MinGW\msys\1.0\home\autobuild\tools DefaultDirName=C:\MinGW\msys\1.0\home\autobuild\tools
DefaultGroupName={#MyAppName} DefaultGroupName={#MyAppName}
AllowNoIcons=yes AllowNoIcons=yes
@ -57,8 +58,39 @@ Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl" Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.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] [Files]
Source: ".\install.bat"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs Source: ".\install.bat"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Run] [Run]
Filename: "{app}\install.bat"; description: "install script"; StatusMsg: "Installing toolchain"; Parameters: "{app}"; Flags: runhidden logoutput 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;