; DockHub installer (Inno Setup 6) ; Build with installer\build.ps1, which publishes the app and passes the version and source folder. #define MyAppName "DockHub" #define MyAppExe "DockHub.exe" #define MyAppPublisher "DockHub" #define MyAppURL "https://github.com/sametgurtuna/DockHub" #ifndef MyAppVersion #define MyAppVersion "0.6.1" #endif ; x64 or arm64: the processor the published DockHub is for (build.ps1 -Runtime win-arm64 passes arm64). #ifndef MyArch #define MyArch "x64" #endif #ifndef SourceDir #define SourceDir "..\artifacts\publish\win-" + MyArch #endif #if MyArch == "arm64" #define MyArchitectures "arm64" #else #define MyArchitectures "x64compatible" #endif [Setup] AppId={{6F2B7E14-3C1A-4D5B-9E27-8A41C0D5B3F2} AppName={#MyAppName} AppVersion={#MyAppVersion} AppVerName={#MyAppName} {#MyAppVersion} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL}/issues AppUpdatesURL={#MyAppURL}/releases DefaultDirName={autopf}\{#MyAppName} DisableProgramGroupPage=yes ; DockHub never needs admin rights, so it installs per user by default. PrivilegesRequired=lowest PrivilegesRequiredOverridesAllowed=dialog UsedUserAreasWarning=no ; An x64 DockHub also installs on ARM64 Windows 11 (emulated); the arm64 one only there. ArchitecturesAllowed={#MyArchitectures} ArchitecturesInstallIn64BitMode={#MyArchitectures} MinVersion=10.0.17763 OutputDir=Output OutputBaseFilename=DockHub-Setup-{#MyAppVersion}-{#MyArch} SetupIconFile=..\src\CustomDock\Assets\DockHub.ico UninstallDisplayIcon={app}\{#MyAppExe} UninstallDisplayName={#MyAppName} VersionInfoVersion={#MyAppVersion} VersionInfoProductName={#MyAppName} VersionInfoDescription={#MyAppName} Setup Compression=lzma2/ultra64 SolidCompression=yes WizardStyle=modern CloseApplications=no RestartApplications=no ; .dockwidget packages open in DockHub (registered for the current user below). ChangesAssociations=yes [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl" Name: "german"; MessagesFile: "compiler:Languages\German.isl" Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl" [CustomMessages] english.StartupGroup=Startup: turkish.StartupGroup=Başlangıç: german.StartupGroup=Autostart: spanish.StartupGroup=Inicio: english.StartupTask=Start DockHub automatically when I sign in to Windows turkish.StartupTask=Windows'a giriş yaptığımda DockHub'ı otomatik başlat german.StartupTask=DockHub bei der Anmeldung an Windows automatisch starten spanish.StartupTask=Iniciar DockHub automáticamente al iniciar sesión en Windows english.LaunchApp=Launch DockHub now turkish.LaunchApp=DockHub'ı şimdi başlat german.LaunchApp=DockHub jetzt starten spanish.LaunchApp=Iniciar DockHub ahora english.WidgetFileType=DockHub widget turkish.WidgetFileType=DockHub widget'ı german.WidgetFileType=DockHub-Widget spanish.WidgetFileType=Widget de DockHub [Tasks] Name: "startup"; Description: "{cm:StartupTask}"; GroupDescription: "{cm:StartupGroup}" Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked [Files] Source: "{#SourceDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs [Icons] Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExe}" Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExe}"; Tasks: desktopicon [Registry] ; Same value the app's own "Start with Windows" setting writes, so both stay in sync. Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "{#MyAppName}"; ValueData: """{app}\{#MyAppExe}"" --startup"; Tasks: startup; Flags: uninsdeletevalue Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: none; ValueName: "{#MyAppName}"; Tasks: not startup; Flags: deletevalue uninsdeletevalue ; Pre-rename autostart entry. Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: none; ValueName: "CustomDock"; Flags: deletevalue ; The app reads this on its first run to pick the default for its own setting. Root: HKCU; Subkey: "Software\DockHub"; ValueType: dword; ValueName: "StartWithWindows"; ValueData: 1; Tasks: startup; Flags: uninsdeletekey Root: HKCU; Subkey: "Software\DockHub"; ValueType: dword; ValueName: "StartWithWindows"; ValueData: 0; Tasks: not startup; Flags: uninsdeletekey ; Explorer "Pin to DockHub" verbs the app registers at runtime. Root: HKCU; Subkey: "Software\Classes\exefile\shell\DockHub.Pin"; Flags: uninsdeletekey dontcreatekey Root: HKCU; Subkey: "Software\Classes\lnkfile\shell\DockHub.Pin"; Flags: uninsdeletekey dontcreatekey ; .dockwidget packages: opening one in File Explorer shows DockHub's install dialog ("DockHub.exe --install-widget"). Root: HKCU; Subkey: "Software\Classes\.dockwidget"; ValueType: string; ValueName: ""; ValueData: "DockHub.Widget"; Flags: uninsdeletevalue Root: HKCU; Subkey: "Software\Classes\DockHub.Widget"; ValueType: string; ValueName: ""; ValueData: "{cm:WidgetFileType}"; Flags: uninsdeletekey Root: HKCU; Subkey: "Software\Classes\DockHub.Widget\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExe}"",0" Root: HKCU; Subkey: "Software\Classes\DockHub.Widget\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExe}"" --install-widget ""%1""" [Run] Filename: "{app}\{#MyAppExe}"; Description: "{cm:LaunchApp}"; Flags: nowait postinstall skipifsilent ; Silent installs come from the in-app updater: start the new version again right away. Filename: "{app}\{#MyAppExe}"; Parameters: "--startup"; Flags: nowait skipifnotsilent [Code] procedure RunDockHub(const Args: String); var Exe: String; ResultCode: Integer; begin Exe := ExpandConstant('{app}\{#MyAppExe}'); if FileExists(Exe) then Exec(Exe, Args, '', SW_HIDE, ewWaitUntilTerminated, ResultCode); end; function PrepareToInstall(var NeedsRestart: Boolean): String; begin { An upgrade must not replace files while the dock is running; --exit also brings the Windows taskbar back. } RunDockHub('--exit'); Sleep(1500); Result := ''; end; function InitializeUninstall(): Boolean; begin RunDockHub('--exit'); Sleep(1500); RunDockHub('--restore-taskbar'); Result := True; end;