fix: improve per-user MSI installer component tracking

- Change File KeyPath to "no" and use registry value as KeyPath instead
- Add registry entry for better component state tracking
- Enhance uninstall cleanup to remove LocalAppData files and folders
This commit is contained in:
farion1231
2025-09-23 20:55:30 +08:00
parent 4dd07dfd85
commit 20f0dd7e1c

View File

@@ -145,7 +145,8 @@
{{/each~}} {{/each~}}
</Component> </Component>
<Component Id="Path" Guid="{{path_component_guid}}" Win64="$(var.Win64)"> <Component Id="Path" Guid="{{path_component_guid}}" Win64="$(var.Win64)">
<File Id="Path" Source="{{main_binary_path}}" KeyPath="yes" Checksum="yes"/> <File Id="Path" Source="{{main_binary_path}}" KeyPath="no" Checksum="yes"/>
<RegistryValue Root="HKCU" Key="Software\{{manufacturer}}\{{product_name}}" Name="PathComponent" Type="integer" Value="1" KeyPath="yes" />
{{#each file_associations as |association| ~}} {{#each file_associations as |association| ~}}
{{#each association.ext as |ext| ~}} {{#each association.ext as |ext| ~}}
<ProgId Id="{{../../product_name}}.{{ext}}" Advertise="yes" Description="{{association.description}}"> <ProgId Id="{{../../product_name}}.{{ext}}" Advertise="yes" Description="{{association.description}}">
@@ -181,6 +182,9 @@
Target="[System64Folder]msiexec.exe" Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]" /> Arguments="/x [ProductCode]" />
<RemoveFile Id="RemoveUserProgramsFiles" Directory="TauriLocalAppDataPrograms" Name="*" On="uninstall" />
<RemoveFolder Id="RemoveUserProgramsFolder" Directory="TauriLocalAppDataPrograms" On="uninstall" />
<RemoveFolder Id="INSTALLDIR" <RemoveFolder Id="INSTALLDIR"
On="uninstall" /> On="uninstall" />