Skip to content

Commit 30ccaf5

Browse files
committed
fix: keep local app data folder on uninstall
1 parent 70e2cc6 commit 30ccaf5

1 file changed

Lines changed: 79 additions & 77 deletions

File tree

Installer/Product.wxs

Lines changed: 79 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3-
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
4-
<?define ProductName="GhostDraw" ?>
5-
<?define Manufacturer="RuntimeRascal" ?>
6-
<?define UpgradeCode="A8B9C0D1-2E3F-4A5B-6C7D-8E9F0A1B2C3D" ?>
3+
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
4+
<?define ProductName="GhostDraw"?>
5+
<?define Manufacturer="RuntimeRascal"?>
6+
<?define UpgradeCode="A8B9C0D1-2E3F-4A5B-6C7D-8E9F0A1B2C3D"?>
77

88
<Package Name="$(var.ProductName)"
9-
Manufacturer="$(var.Manufacturer)"
10-
Version="$(var.ProductVersion)"
11-
UpgradeCode="$(var.UpgradeCode)"
12-
Compressed="yes"
13-
InstallerVersion="500"
14-
Scope="perMachine">
15-
16-
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed. Please uninstall the current version before installing this version."
17-
AllowSameVersionUpgrades="yes"
18-
Schedule="afterInstallInitialize" />
9+
Manufacturer="$(var.Manufacturer)"
10+
Version="$(var.ProductVersion)"
11+
UpgradeCode="$(var.UpgradeCode)"
12+
Compressed="yes"
13+
InstallerVersion="500"
14+
Scope="perMachine">
15+
16+
<MajorUpgrade
17+
DowngradeErrorMessage="A newer version of [ProductName] is already installed. Please uninstall the current version before installing this version."
18+
AllowSameVersionUpgrades="yes"
19+
Schedule="afterInstallInitialize" />
1920

2021
<MediaTemplate EmbedCab="yes" />
2122

@@ -38,7 +39,7 @@
3839

3940
<!-- Start Menu folder -->
4041
<StandardDirectory Id="ProgramMenuFolder">
41-
<Directory Id="ApplicationProgramsFolder" Name="$(var.ProductName)"/>
42+
<Directory Id="ApplicationProgramsFolder" Name="$(var.ProductName)" />
4243
</StandardDirectory>
4344

4445
<!-- Desktop folder -->
@@ -54,39 +55,39 @@
5455

5556
<!-- Main Application Feature (Required) -->
5657
<Feature Id="MainApplication"
57-
Title="GhostDraw Application"
58-
Level="1"
59-
ConfigurableDirectory="INSTALLFOLDER"
60-
AllowAdvertise="no"
61-
Description="Core application files (required)">
58+
Title="GhostDraw Application"
59+
Level="1"
60+
ConfigurableDirectory="INSTALLFOLDER"
61+
AllowAdvertise="no"
62+
Description="Core application files (required)">
6263
<ComponentGroupRef Id="ProductComponents" />
6364
<ComponentGroupRef Id="SettingsComponents" />
6465
</Feature>
6566

6667
<!-- Start Menu Shortcut Feature (Default: Yes) -->
6768
<Feature Id="StartMenuShortcut"
68-
Title="Start Menu Shortcut"
69-
Level="1"
70-
AllowAdvertise="no"
71-
Description="Add a shortcut to the Start Menu">
69+
Title="Start Menu Shortcut"
70+
Level="1"
71+
AllowAdvertise="no"
72+
Description="Add a shortcut to the Start Menu">
7273
<ComponentRef Id="StartMenuShortcutComponent" />
7374
</Feature>
7475

7576
<!-- Desktop Shortcut Feature (Default: No) -->
7677
<Feature Id="DesktopShortcut"
77-
Title="Desktop Shortcut"
78-
Level="1000"
79-
AllowAdvertise="no"
80-
Description="Add a shortcut to the Desktop">
78+
Title="Desktop Shortcut"
79+
Level="1000"
80+
AllowAdvertise="no"
81+
Description="Add a shortcut to the Desktop">
8182
<ComponentRef Id="DesktopShortcutComponent" />
8283
</Feature>
8384

8485
<!-- Startup Shortcut Feature (Default: No) -->
8586
<Feature Id="StartupShortcut"
86-
Title="Run at Windows Startup"
87-
Level="1000"
88-
AllowAdvertise="no"
89-
Description="Automatically start GhostDraw when you log in to Windows">
87+
Title="Run at Windows Startup"
88+
Level="1000"
89+
AllowAdvertise="no"
90+
Description="Automatically start GhostDraw when you log in to Windows">
9091
<ComponentRef Id="StartupShortcutComponent" />
9192
</Feature>
9293

@@ -103,20 +104,21 @@
103104
</Fragment>
104105

105106
<!-- Component Group auto-generated by Generate-FileList.ps1 script -->
106-
<?include HarvestedFiles.wxs ?>
107+
<?include HarvestedFiles.wxs?>
107108

108-
<!-- Settings folder reference (persists across upgrades) -->
109+
<!-- Settings folder reference (persists across upgrades and uninstall) -->
109110
<Fragment>
110111
<ComponentGroup Id="SettingsComponents" Directory="GhostDrawSettingsFolder">
111112
<Component Id="SettingsFolderRef" Guid="A6B7C8D9-0E1F-2A3B-4C5D-6E7F8A9B0C1D">
112113
<CreateFolder />
113-
<RemoveFolder Id="CleanupSettings" On="uninstall" />
114+
<!-- Note: We intentionally do NOT remove the settings folder on uninstall -->
115+
<!-- This preserves user settings for reinstallation or manual backup -->
114116
<RegistryValue Root="HKCU"
115-
Key="Software\$(var.Manufacturer)\$(var.ProductName)"
116-
Name="SettingsPath"
117-
Value="[LocalAppDataFolder]$(var.ProductName)"
118-
Type="string"
119-
KeyPath="yes" />
117+
Key="Software\$(var.Manufacturer)\$(var.ProductName)"
118+
Name="SettingsPath"
119+
Value="[LocalAppDataFolder]$(var.ProductName)"
120+
Type="string"
121+
KeyPath="yes" />
120122
</Component>
121123
</ComponentGroup>
122124
</Fragment>
@@ -125,57 +127,57 @@
125127
<Fragment>
126128
<!-- Start Menu Shortcut -->
127129
<Component Id="StartMenuShortcutComponent"
128-
Guid="A1B2C3D4-5E6F-7A8B-9C0D-1E2F3A4B5C6D"
129-
Directory="ApplicationProgramsFolder">
130+
Guid="A1B2C3D4-5E6F-7A8B-9C0D-1E2F3A4B5C6D"
131+
Directory="ApplicationProgramsFolder">
130132
<Shortcut Id="StartMenuShortcut"
131-
Name="GhostDraw"
132-
Description="Draw directly on your screen"
133-
Target="[INSTALLFOLDER]GhostDraw.exe"
134-
WorkingDirectory="INSTALLFOLDER"
135-
Icon="AppIcon" />
133+
Name="GhostDraw"
134+
Description="Draw directly on your screen"
135+
Target="[INSTALLFOLDER]GhostDraw.exe"
136+
WorkingDirectory="INSTALLFOLDER"
137+
Icon="AppIcon" />
136138
<RemoveFolder Id="CleanupStartMenu" On="uninstall" />
137139
<RegistryValue Root="HKCU"
138-
Key="Software\RuntimeRascal\GhostDraw\Shortcuts"
139-
Name="StartMenu"
140-
Value="1"
141-
Type="integer"
142-
KeyPath="yes" />
140+
Key="Software\RuntimeRascal\GhostDraw\Shortcuts"
141+
Name="StartMenu"
142+
Value="1"
143+
Type="integer"
144+
KeyPath="yes" />
143145
</Component>
144146

145147
<!-- Desktop Shortcut -->
146148
<Component Id="DesktopShortcutComponent"
147-
Guid="B2C3D4E5-6F7A-8B9C-0D1E-2F3A4B5C6D7E"
148-
Directory="DesktopFolder">
149+
Guid="B2C3D4E5-6F7A-8B9C-0D1E-2F3A4B5C6D7E"
150+
Directory="DesktopFolder">
149151
<Shortcut Id="DesktopShortcut"
150-
Name="GhostDraw"
151-
Description="Draw directly on your screen"
152-
Target="[INSTALLFOLDER]GhostDraw.exe"
153-
WorkingDirectory="INSTALLFOLDER"
154-
Icon="AppIcon" />
152+
Name="GhostDraw"
153+
Description="Draw directly on your screen"
154+
Target="[INSTALLFOLDER]GhostDraw.exe"
155+
WorkingDirectory="INSTALLFOLDER"
156+
Icon="AppIcon" />
155157
<RegistryValue Root="HKCU"
156-
Key="Software\RuntimeRascal\GhostDraw\Shortcuts"
157-
Name="Desktop"
158-
Value="1"
159-
Type="integer"
160-
KeyPath="yes" />
158+
Key="Software\RuntimeRascal\GhostDraw\Shortcuts"
159+
Name="Desktop"
160+
Value="1"
161+
Type="integer"
162+
KeyPath="yes" />
161163
</Component>
162164

163165
<!-- Startup Shortcut -->
164166
<Component Id="StartupShortcutComponent"
165-
Guid="C3D4E5F6-7A8B-9C0D-1E2F-3A4B5C6D7E8F"
166-
Directory="StartupFolder">
167+
Guid="C3D4E5F6-7A8B-9C0D-1E2F-3A4B5C6D7E8F"
168+
Directory="StartupFolder">
167169
<Shortcut Id="StartupShortcut"
168-
Name="GhostDraw"
169-
Description="Draw directly on your screen"
170-
Target="[INSTALLFOLDER]GhostDraw.exe"
171-
Arguments="--minimized"
172-
WorkingDirectory="INSTALLFOLDER" />
170+
Name="GhostDraw"
171+
Description="Draw directly on your screen"
172+
Target="[INSTALLFOLDER]GhostDraw.exe"
173+
Arguments="--minimized"
174+
WorkingDirectory="INSTALLFOLDER" />
173175
<RegistryValue Root="HKCU"
174-
Key="Software\RuntimeRascal\GhostDraw\Shortcuts"
175-
Name="Startup"
176-
Value="1"
177-
Type="integer"
178-
KeyPath="yes" />
176+
Key="Software\RuntimeRascal\GhostDraw\Shortcuts"
177+
Name="Startup"
178+
Value="1"
179+
Type="integer"
180+
KeyPath="yes" />
179181
</Component>
180182
</Fragment>
181-
</Wix>
183+
</Wix>

0 commit comments

Comments
 (0)