From 90465b1dce261865fa3146acc2d7e7a91c601c43 Mon Sep 17 00:00:00 2001 From: Abdulwahb Isam Date: Fri, 16 Oct 2026 08:51:45 +0300 Subject: [PATCH] disktree: feat: add an Inno Setup script for a Windows installer packaging/windows/disktree.iss builds disktree---windows- setup.exe from the release binary. It installs for the current user with no UAC prompt by default (the first page offers all users), adds a Start menu entry, a desktop shortcut and an uninstaller in Settings > Apps, and upgrades in place, keyed by a fixed AppId. x86_64 and aarch64 each get their own setup. Verified with Inno Setup 7.1.0 on Windows 11 x64: ISCC compiles cleanly; leaving out /DArch or passing an unknown one aborts the compile; a silent /CURRENTUSER install creates the exe, both shortcuts and the uninstall entry, and disktree launches; a second install upgrades with one uninstall entry; unins000.exe removes all of it including the install folder. --- packaging/windows/disktree.iss | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 packaging/windows/disktree.iss diff --git a/packaging/windows/disktree.iss b/packaging/windows/disktree.iss new file mode 100644 index 0000000..503458c --- /dev/null +++ b/packaging/windows/disktree.iss @@ -0,0 +1,67 @@ +; The Windows installer, compiled by Inno Setup 7 from the repo root: +; +; ISCC.exe /DAppVersion=0.11.0 /DArch=x86_64 packaging\windows\disktree.iss +; +; after `cargo build --release`. It writes +; target\bundle\disktree---windows-setup.exe. + +#ifndef AppVersion + #error Pass the version: /DAppVersion= +#endif + +; One installer per release build, named like the zip. The setup program +; itself is x64 either way; on Arm64 Windows 11 it runs emulated and +; installs the native arm64 binary. +#ifndef Arch + #error Pass the architecture: /DArch=x86_64 or /DArch=aarch64 +#elif Arch == "x86_64" + #define Archs "x64compatible" +#elif Arch == "aarch64" + #define Archs "arm64" +#else + #error Arch must be x86_64 or aarch64 +#endif + +[Setup] +; Upgrades and the uninstaller find an existing install by this id, so it +; must never change; a new one would install disktree a second time. +AppId={{354830A5-B031-45DE-8595-4513BA422E5F} +AppName=disktree +AppVersion={#AppVersion} +AppPublisherURL=https://github.com/tobi/disktree +AppSupportURL=https://github.com/tobi/disktree/issues +AppUpdatesURL=https://github.com/tobi/disktree/releases +; Paths below are relative to the repo root, not to this script. +SourceDir=..\.. +OutputDir=target\bundle +OutputBaseFilename=disktree-{#AppVersion}-{#Arch}-windows-setup +SetupIconFile=assets\disktree.ico +UninstallDisplayIcon={app}\disktree.exe +SetupArchitecture=x64 +ArchitecturesAllowed={#Archs} +ArchitecturesInstallIn64BitMode={#Archs} +; For the current user by default, with no UAC prompt, as `make install` +; puts it under ~/.local; the first page offers all users instead. +PrivilegesRequired=lowest +PrivilegesRequiredOverridesAllowed=dialog +DefaultDirName={autopf}\disktree +DisableProgramGroupPage=yes +MinVersion=10.0 +WizardStyle=modern +Compression=lzma2/max +SolidCompression=yes + +[Tasks] +Name: desktopicon; Description: "{cm:CreateDesktopIcon}" + +[Files] +Source: "target\release\disktree.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "README.md"; DestDir: "{app}" +Source: "LICENSE"; DestDir: "{app}" + +[Icons] +Name: "{autoprograms}\disktree"; Filename: "{app}\disktree.exe" +Name: "{autodesktop}\disktree"; Filename: "{app}\disktree.exe"; Tasks: desktopicon + +[Run] +Filename: "{app}\disktree.exe"; Description: "{cm:LaunchProgram,disktree}"; Flags: postinstall nowait skipifsilent