109 lines
4.6 KiB
Plaintext
109 lines
4.6 KiB
Plaintext
; Inno Setup script for Ebbe's Meme Clipboard.
|
|
;
|
|
; Build with:
|
|
; "%LocalAppData%\Programs\Inno Setup 6\ISCC.exe" installer\EbbesMemeClipboard.iss
|
|
;
|
|
; Expects an installer-flavoured publish first (note: compression DISABLED on purpose):
|
|
; dotnet publish src\EbbesMemeClipboard\EbbesMemeClipboard.csproj -c Release -r win-x64 ^
|
|
; --self-contained true -p:PublishSingleFile=true ^
|
|
; -p:IncludeNativeLibrariesForSelfExtract=true -p:EnableCompressionInSingleFile=false ^
|
|
; -o publish-installer
|
|
;
|
|
; Leaving .NET's own single-file compression off lets Inno's LZMA2 compress the raw bytes
|
|
; instead, which it does far better: ~51 MB setup vs ~70 MB when double-compressing. The
|
|
; installed exe is larger on disk (172 MB vs 75 MB) but starts faster, since there's no
|
|
; decompression on launch. The separate publish\ folder keeps the compressed build for
|
|
; anyone who just wants the portable single exe.
|
|
|
|
#define AppName "Ebbe's Meme Clipboard"
|
|
#define AppVersion "1.1.0"
|
|
#define AppPublisher "Ebbe Baß"
|
|
#define AppExeName "EbbesMemeClipboard.exe"
|
|
#define SourceExe "..\publish-installer\EbbesMemeClipboard.exe"
|
|
|
|
[Setup]
|
|
AppId={{8E4C1F02-6B3A-4D77-9C21-5A0E7F3B9D64}
|
|
AppName={#AppName}
|
|
AppVersion={#AppVersion}
|
|
AppVerName={#AppName} {#AppVersion}
|
|
AppPublisher={#AppPublisher}
|
|
DefaultDirName={autopf}\Ebbes Meme Clipboard
|
|
DefaultGroupName={#AppName}
|
|
UninstallDisplayName={#AppName}
|
|
UninstallDisplayIcon={app}\{#AppExeName}
|
|
OutputDir=.\output
|
|
OutputBaseFilename=EbbesMemeClipboard-Setup-{#AppVersion}
|
|
SetupIconFile=..\src\EbbesMemeClipboard\Assets\tray-icon.ico
|
|
Compression=lzma2/max
|
|
SolidCompression=yes
|
|
WizardStyle=modern
|
|
DisableProgramGroupPage=yes
|
|
ArchitecturesAllowed=x64compatible
|
|
ArchitecturesInstallIn64BitMode=x64compatible
|
|
|
|
; Default to a per-user install so no UAC prompt is needed, but show a dialog letting the
|
|
; user pick "just me" or "all users". {autopf} then resolves to LocalAppData\Programs or
|
|
; Program Files to match whichever they chose.
|
|
PrivilegesRequired=lowest
|
|
PrivilegesRequiredOverridesAllowed=dialog
|
|
|
|
; The app has no single-instance mutex, so a running copy would hold a lock on the exe and
|
|
; break an upgrade. Restart Manager closes it first and reopens it afterwards.
|
|
CloseApplications=yes
|
|
RestartApplications=yes
|
|
|
|
[Languages]
|
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
|
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
|
|
|
|
[Tasks]
|
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
|
Name: "autostart"; Description: "Start {#AppName} when Windows starts"; GroupDescription: "Startup:"; Flags: unchecked
|
|
|
|
[Files]
|
|
Source: "{#SourceExe}"; DestDir: "{app}"; Flags: ignoreversion
|
|
|
|
[Icons]
|
|
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"
|
|
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"
|
|
Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon
|
|
|
|
[Registry]
|
|
; Same value name the app's own Settings toggle manages, so the installer checkbox and the
|
|
; in-app checkbox stay in agreement instead of fighting over two separate entries.
|
|
Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; \
|
|
ValueName: "EbbesMemeClipboard"; ValueData: """{app}\{#AppExeName}"""; \
|
|
Flags: uninsdeletevalue; Tasks: autostart
|
|
|
|
[Run]
|
|
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#AppName}}"; \
|
|
Flags: nowait postinstall skipifsilent
|
|
|
|
[UninstallDelete]
|
|
; The app writes its library/settings under %AppData% and a re-downloadable cache under
|
|
; %LocalAppData%. Only the cache is removed automatically - the user's own memes, favourites
|
|
; and settings are deliberately left behind so an uninstall/reinstall doesn't destroy them.
|
|
Type: filesandordirs; Name: "{localappdata}\EbbesMemeClipboard\GifCache"
|
|
|
|
[Code]
|
|
// Clean up the autostart entry on uninstall, but ONLY when it actually points at the copy
|
|
// being removed. The app's own Settings toggle writes the same value name, so a user running
|
|
// a portable build alongside this one would otherwise have their autostart silently deleted
|
|
// by an uninstall that had nothing to do with it.
|
|
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
|
|
var
|
|
Existing: String;
|
|
AppPath: String;
|
|
begin
|
|
if CurUninstallStep <> usPostUninstall then
|
|
Exit;
|
|
|
|
if not RegQueryStringValue(HKCU, 'Software\Microsoft\Windows\CurrentVersion\Run',
|
|
'EbbesMemeClipboard', Existing) then
|
|
Exit;
|
|
|
|
AppPath := LowerCase(ExpandConstant('{app}'));
|
|
if Pos(AppPath, LowerCase(Existing)) > 0 then
|
|
RegDeleteValue(HKCU, 'Software\Microsoft\Windows\CurrentVersion\Run', 'EbbesMemeClipboard');
|
|
end;
|