|
| 1 | +; Script generated by the Inno Setup Script Wizard. |
| 2 | +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! |
| 3 | +; Non-commercial use only |
| 4 | + |
| 5 | +#define MyAppName "HalcyonRT" |
| 6 | +#define MyAppVersion "0.18.26" |
| 7 | +#define MyAppPublisher "KAInaps" |
| 8 | +#define MyAppURL "https://halcyonscript.ddns.net/" |
| 9 | +#define MyAppExeName "Halcyon.exe" |
| 10 | +#define MyAppAssocName "HalcyonScript App" |
| 11 | +#define MyAppAssocExt ".hcs" |
| 12 | +#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt |
| 13 | + |
| 14 | +[Setup] |
| 15 | +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. |
| 16 | +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) |
| 17 | +AppId={{56E27055-C985-4BE9-A22A-5BDBC8A58741} |
| 18 | +AppName={#MyAppName} |
| 19 | +AppVersion={#MyAppVersion} |
| 20 | +;AppVerName={#MyAppName} {#MyAppVersion} |
| 21 | +AppPublisher={#MyAppPublisher} |
| 22 | +AppPublisherURL={#MyAppURL} |
| 23 | +AppSupportURL={#MyAppURL} |
| 24 | +AppUpdatesURL={#MyAppURL} |
| 25 | +DefaultDirName={autopf}\{#MyAppName} |
| 26 | +UninstallDisplayIcon={app}\{#MyAppExeName} |
| 27 | +; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run |
| 28 | +; on anything but x64 and Windows 11 on Arm. |
| 29 | +ArchitecturesAllowed=x64compatible |
| 30 | +; "ArchitecturesInstallIn64BitMode=x64compatible" requests that the |
| 31 | +; install be done in "64-bit mode" on x64 or Windows 11 on Arm, |
| 32 | +; meaning it should use the native 64-bit Program Files directory and |
| 33 | +; the 64-bit view of the registry. |
| 34 | +ArchitecturesInstallIn64BitMode=x64compatible |
| 35 | +ChangesAssociations=yes |
| 36 | +ChangesEnvironment=yes |
| 37 | +DisableProgramGroupPage=yes |
| 38 | +LicenseFile=C:\Users\oem\Desktop\Halcyon\HalcyonScript-Native\license.rtf |
| 39 | +InfoAfterFile=C:\Users\oem\Desktop\Halcyon\HalcyonScript-Native\infoo.txt |
| 40 | +; Uncomment the following line to run in non administrative install mode (install for current user only). |
| 41 | +;PrivilegesRequired=lowest |
| 42 | +OutputDir=C:\Users\oem\Desktop\Halcyon\HalcyonScript-Native\innosetup |
| 43 | +OutputBaseFilename=setuphsrt |
| 44 | +SetupIconFile=C:\Users\oem\Desktop\Halcyon\HalcyonScript-Native\logo\halcyon.ico |
| 45 | +SolidCompression=yes |
| 46 | +WizardStyle=modern polar |
| 47 | + |
| 48 | +[Languages] |
| 49 | +Name: "english"; MessagesFile: "compiler:Default.isl" |
| 50 | +Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" |
| 51 | + |
| 52 | +[Tasks] |
| 53 | +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked |
| 54 | +Name: "envpath"; Description: "Add to PATH (allows running 'halcyon' from command line)"; GroupDescription: "System Integration:" |
| 55 | + |
| 56 | +[Files] |
| 57 | +Source: "C:\Users\oem\Desktop\Halcyon\HalcyonScript-Native\dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion |
| 58 | +Source: "C:\Users\oem\Desktop\Halcyon\HalcyonScript-Native\dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs |
| 59 | +; NOTE: Don't use "Flags: ignoreversion" on any shared system files |
| 60 | + |
| 61 | +[Registry] |
| 62 | +Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue |
| 63 | +Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey |
| 64 | +Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0" |
| 65 | +Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1""" |
| 66 | +; Add to PATH |
| 67 | +Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Tasks: envpath; Check: NeedsAddPath('{app}') |
| 68 | + |
| 69 | +[Icons] |
| 70 | +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" |
| 71 | +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon |
| 72 | + |
| 73 | +[Run] |
| 74 | +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent |
| 75 | + |
| 76 | +[Code] |
| 77 | +function NeedsAddPath(Param: string): boolean; |
| 78 | +var |
| 79 | + OrigPath: string; |
| 80 | +begin |
| 81 | + if not RegQueryStringValue(HKEY_LOCAL_MACHINE, |
| 82 | + 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', |
| 83 | + 'Path', OrigPath) |
| 84 | + then begin |
| 85 | + Result := True; |
| 86 | + exit; |
| 87 | + end; |
| 88 | + // look for the path with leading and trailing semicolon |
| 89 | + // Pos() returns 0 if not found |
| 90 | + Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0; |
| 91 | +end; |
| 92 | +
|
| 93 | +procedure CurStepChanged(CurStep: TSetupStep); |
| 94 | +var |
| 95 | + ResultCode: Integer; |
| 96 | +begin |
| 97 | + if CurStep = ssPostInstall then |
| 98 | + begin |
| 99 | + if IsTaskSelected('envpath') then |
| 100 | + begin |
| 101 | + // Notify system of environment variable change |
| 102 | + // This makes the PATH change take effect without reboot |
| 103 | + if Exec(ExpandConstant('{sys}\cmd.exe'), '/c setx HALCYON_HOME "' + ExpandConstant('{app}') + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then |
| 104 | + begin |
| 105 | + // Success |
| 106 | + end; |
| 107 | + end; |
| 108 | + end; |
| 109 | +end; |
| 110 | +
|
0 commit comments