[wix-users] Forced removal of shortcut directories?
Brian Enderle
brianke at gmail.com
Fri Nov 13 04:57:21 PST 2015
I am curious why a //RemoveFolder element is required for folders that
contain shortcuts but not the other folders I create during install.
For instance, I build the following file structure and install my exe with
shortcuts:
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<!-- Program Menu Folders (i.e., Start Button) -->
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuFolderCompany" Name="$(var.CompanyName)"
/>
</Directory>
<!-- x86 Program File Folders (i.e., C:\Program Files (x86)\ ) -->
<Directory Id="ProgramFilesFolder">
<Directory Id="ProgramFilesCompany" Name="$(var.CompanyName)" >
<Directory Id="INSTALLFOLDER" Name="$(var.ProductName)">
</Directory>
</Directory>
</Directory>
<!-- Program Data Folders (i.e., C:\ProgramData, typically a hidden
folder) -->
<Directory Id="CommonAppDataFolder">
<Directory Id="CompanyAppFolder" Name="$(var.CompanyName)">
<Directory Id="AppFolder" Name="$(var.ProductName)" />
</Directory>
</Directory>
</Directory>
</Fragment>
<!-- Program files to be installed -->
<Fragment>
<!-- Program File Folders (i.e., C:\Program Files (x86)\ ) -->
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="AutomatedSQLMigrationEXE">
<File Id="AutomatedSQLMigrationEXE"
Source="$(var.AutomatedSQLMigration.TargetDir)AutomatedSQLMigration.exe"
Vital="yes"
KeyPath="yes">
<!-- Create Shortcut the program menu dir -->
<Shortcut Id="ProgramMenuDirShortcut"
Name="$(var.ProductName)"
Description="My Product"
Directory="ProgramMenuFolderCompany"
WorkingDirectory="INSTALLFOLDER"
Advertise="yes" />
</File>
<!-- Remove Start Menu -> Delphia Consulting ->
AutomatedSQLMigration-->
<!--<RemoveFolder Id="RemoveProgramMenuFolderApplication"
Directory="ProgramMenuFolderCompany" On="uninstall" />-->
</Component>
</Fragment>
If I build the Product.wxs using the above I get an ICE64 error (The
directory ProgramMenuFolderCompany is in the user profile but is not listed
in the RemoveFile table.)
If I uncomment the //RemoveFile element is builds correctly.
Why is //RemoveFolder required for ProgramMenuFolderCompany but not for
other folders I create (i.e., ProgramFilesCompany, CompanyAppFolder).
Uninstalling the product correctly uninstalls all of these folders without
a //RemoveFolder element.
Brian
If you can't explain it simply, you don't understand it well enough. -
Albert Einstein
More information about the wix-users
mailing list