1. MSI SDK says the RemoveFolders only removes a folder if it is empty.  
You need a CustomAction to recurse all of the directories and add them 
to the RemoveFolders table plus add the files to RemoveFiles table.

2.  I vaguely rememeber some tricky limitations around Shortcut Icons in 
MSI.  You might try reading about those topics in the MSI SDK.

Curtis Jewell wrote:
> I've got two problems I need help with, and I hope somebody here can
> help me with them.
>
> I'm using WiX 3.0.5210, by the way.
>
> First problem: When I install a (major) upgrade, it's not deleting any
> files that were created in the [D_Perl] directory or subdirectories that
> were not installed by the MSI.  I thought the RemoveFolder tag did just
> that. What else do I need to do?
>
> (Note that if this has to be implemented as a custom action, the custom
> action has to be compilable using the MingW-gcc toolchain, instead of
> using Visual Studio.  I don't know if that toolchain has the msi import
> libraries yet.)
>
> Second problem: The shortcut [C_S_CPAN_Client] is being created, but its
> icon [I_cpan.bat] is not being displayed (It gets replaced by the normal
> batch file icon, and when I try to change the icon, it says that there
> are no icons in the applicable file.)  The icon file referred to is a
> copy of the icon file [I_cpanweb.url] being used in [C_S_CPAN_Search],
> which IS being displayed.  (I wanted to check and see if the problem
> wasn't that I was referring to the same icon file in two different
> places.) Am I doing something wrong?
>
> Can anybody help me with either or both of these?
>
> Applicable wxs sections are below, the full files (and all the other
> files that are used) are included in
> http://csjewell.comyr.com/work/fragments.zip (280,966 byte file)
>
> Yes, it is being created by a Perl script I'm writing, this isn't
> hand-written (WAY too much to be hand-written)
>
> Main file: (Perl-Dist-WiX Test Perl.wxs)
>
> <?xml version="1.0" encoding="utf-8"?>
> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
>   <Product Id='7B3EE0A1-4FD7-3766-86DD-B1D06F0C4BE1'
>     Language='1033'
>         Manufacturer="Curtis Jewell"
>         Name="Perl-Dist-WiX Perl Test"
>         UpgradeCode="29287F64-E2D6-3E24-91B6-24461B4A6CCA"
>         Version="5.10.1" >
>
>
>     <Package Description='Perl for Win32 operating systems.' Id='*'
>     Languages='1033'
>       Platform='x86' InstallerVersion='200' Compressed='yes'
>       InstallPrivileges='elevated' />
>
>
>     <Media Id="1" Cabinet="Perl.cab" CompressionLevel="high"
>     EmbedCab="yes" />
>
>
>     <CustomAction
>           Id="PreventDowngrading"
>       Error="A newer version of Perl-Dist-WiX Perl Test is already
>       installed." />
>         <Upgrade Id="29287F64-E2D6-3E24-91B6-24461B4A6CCA">
>           <UpgradeVersion
>             Minimum="5.10.1"
>                 IncludeMinimum="yes"
>             OnlyDetect="yes"
>                 Language="1033"
>                 Property="NEWERVERSIONDETECTED" />
>           <UpgradeVersion
>                 Minimum="5.0.0"
>                 IncludeMinimum="yes"
>                 Maximum="5.10.1"
>                 IncludeMaximum="no"
>                 Language="1033"
>                 Property="OLDERVERSIONBEINGUPGRADED" />
>         </Upgrade>
>         <InstallExecuteSequence>
>       <Custom
>             Action="PreventDowngrading"
>         After="FindRelatedProducts">NEWERVERSIONDETECTED</Custom>
>           <RemoveExistingProducts After="InstallInitialize" />
>         </InstallExecuteSequence>
>     <InstallUISequence>
>       <Custom
>             Action="PreventDowngrading"
>         After="FindRelatedProducts">NEWERVERSIONDETECTED</Custom>
>     </InstallUISequence>
>
>     <Condition Message="You need to be an administrator to install this
>     product.">
>       Privileged
>     </Condition>
>
>     <Condition Message="Can only install for all users on the machine.">
>       <![CDATA[ALLUSERS = 1]]>
>     </Condition>
>
>     <Condition Message="Cannot install on Windows 9x or ME systems.">
>       <![CDATA[VersionNT]]>
>     </Condition>
>
>     <Condition Message="Cannot install on Windows NT 4.0 systems.">
>       <![CDATA[VersionNT > 400]]>
>     </Condition>
>
>     <UIRef Id="WixUI_Minimal" />
>     <UIRef Id="WixUI_ErrorProgressText" />
>     <UIRef Id="WixUI_Common" />
>
>     <Property Id="INSTALLDIR">C:\WiXPerl</Property>
>
>     <Directory Id='TARGETDIR' Name='SourceDir'>
>       <Directory Id='INSTALLDIR'>
>         <Directory Id='D_Perl' Name='perl'>
>           <Directory Id='D_DC5CE757_AEB8_3149_81E1_0EE55B238196'
>           Name='bin' />
> <!-- ... (and so on for about 200 lines) -->
>         <Directory Id='D_License' Name='licenses'>
>           <Directory Id='D_FEB85698_C30F_35D7_B48E_EFEF335C9DBA'
>           Name='dmake' />
>           <Directory Id='D_487F41B9_E194_30D2_93CD_01C3A336AB98'
>           Name='gcc' />
>           <Directory Id='D_925475BA_C87A_31C3_B650_8C4F7802DA0B'
>           Name='mingw' />
>           <Directory Id='D_D0DF1DF2_FD07_3F27_9B37_5B905B344ED3'
>           Name='perl' />
>           <Directory Id='D_E77D7635_0114_3FFD_A827_9CC9EB7A4F68'
>           Name='pexports' />
>         </Directory>
>         <Directory Id='D_Cpan' Name='cpan' />
>         <Directory Id='D_Win32' Name='win32' />
>       </Directory>
>       <Directory Id='ProgramMenuFolder'>
>         <Directory Id='D_App_Menu' Name='Perl-Dist-WiX Perl Test' />
>
>       </Directory>
>     </Directory>
>
>     <Feature Id='Complete' Title='Perl-Dist-WiX Perl Test 5.10.0'
>     Description='The complete package.' Level='1'>
>       <ComponentRef Id='C_1B0F58AF_4567_32B8_8639_A6F38538BB2B' />
> <!-- ... (and so on for about 2600 lines, and yes, the components that
> are in the fragments below are included.) -->
>     </Feature>
>
>   <Icon Id='I_cpan.bat'
>   
> SourceFile='C:\strawberry\perl\site\lib\auto\share\dist\Perl-Dist-WiX\cpan.ico'
>   />
>   <Icon Id='I_cpanweb.url'
>   
> SourceFile='C:\strawberry\perl\site\lib\auto\share\dist\Perl-Dist-WiX\cpanweb.ico'
>   />
>   <Icon Id='I_perldoc.url'
>   
> SourceFile='C:\strawberry\perl\site\lib\auto\share\dist\Perl-Dist-WiX\perldoc.ico'
>   />
>   <Icon Id='I_win32.url'
>   
> SourceFile='C:\strawberry\perl\site\lib\auto\share\dist\Perl-Dist-WiX\win32.ico'
>   />
>
>     <Property Id='ARPNOREPAIR'>1</Property>
>     <Property Id='ALLUSERS'>1</Property>
>     <Property Id='ARPCOMMENTS'>Perl-Dist-WiX Perl Test 5.10.0</Property>
>     <Property Id='ARPCONTACT'>Curtis Jewell</Property>
>     <Property
>     Id='ARPURLINFOABOUT'>http://csjewell.comyr.com/perl/</Property>
>
>     <WixVariable Id='WixUILicenseRtf'
>     
> Value='C:\strawberry\perl\site\lib\auto\share\dist\Perl-Dist-WiX\License.rtf'
>     />
>
>   </Product>
> </Wix>
>
> And here's the fragment that tries to remove the folder:
> (PerlFolder.wxs)
>
> <?xml version='1.0' encoding='windows-1252'?>
> <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
>   <Fragment Id='Fr_RemovePerlFolder'>
>     <DirectoryRef Id='D_Perl'>
>       <Component Id='C_RemovePerlFolder'
>       Guid='F26F0747-91C7-367A-87D5-D8AFF00AC946'>
>         <RemoveFolder Id='RF_Perl' On="uninstall"/>
>       </Component>
>     </DirectoryRef>
>   </Fragment>
> </Wix>
>
> And here's the fragment that provides the shortcut icons. (Icons.wxs)
>
> <?xml version='1.0' encoding='windows-1252'?>
> <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
>   <Fragment Id='Fr_Icons'>
>     <DirectoryRef Id='D_App_Menu'>
>       <Component Id='C_S_CPAN_Client'
>       Guid='8C96CA50-D0BE-35D6-954C-B95F7EA03698'>
>         <Shortcut Id='S_CPAN_Client'
>                   Name='CPAN Client'
>                   Description='CPAN Client'
>                   Target='[D_DC5CE757_AEB8_3149_81E1_0EE55B238196]cpan.bat'
>                   Icon='I_cpan.bat'
>                   WorkingDirectory='D_DC5CE757_AEB8_3149_81E1_0EE55B238196'
>                   />
>         <CreateFolder Directory="D_App_Menu" />
>       </Component>
>       <Component Id='C_S_CPAN_Search'
>       Guid='4518C5B7-2BE7-3513-9DB0-1A4D8E1C6340'>
>         <Shortcut Id='S_CPAN_Search'
>                   Name='CPAN Search'
>                   Description='CPAN Search'
>                   Target='[D_Win32]CPAN Search.url'
>                   Icon='I_cpanweb.url'
>                   WorkingDirectory='D_Win32' />
>         <CreateFolder Directory="D_App_Menu" />
>       </Component>
>       <Component Id='C_S_Perl_5.10.0_Documentation'
>       Guid='B7CE40B2-F2C5-3999-8CFE-4382E7445BA8'>
>         <Shortcut Id='S_Perl_5.10.0_Documentation'
>                   Name='Perl 5.10.0 Documentation'
>                   Description='Perl 5.10.0 Documentation'
>                   Target='[D_Win32]Perl 5.10.0 Documentation.url'
>                   Icon='I_perldoc.url'
>                   WorkingDirectory='D_Win32' />
>         <CreateFolder Directory="D_App_Menu" />
>       </Component>
>       <Component Id='C_S_Win32_Perl_Wiki'
>       Guid='A509DF94-1580-3AE9-BCDC-0A3E0E0E08F1'>
>         <Shortcut Id='S_Win32_Perl_Wiki'
>                   Name='Win32 Perl Wiki'
>                   Description='Win32 Perl Wiki'
>                   Target='[D_Win32]Win32 Perl Wiki.url'
>                   Icon='I_win32.url'
>                   WorkingDirectory='D_Win32' />
>         <CreateFolder Directory="D_App_Menu" />
>       </Component>
>       <Component Id='C_RemoveShortcutFolder'
>       Guid='B895E2A7-A342-3EA8-A5D0-00BAE2B4B08C'>
>         <RemoveFolder Id="D_App_Menu" On="uninstall" />
>       </Component>
>     </DirectoryRef>
>   </Fragment>
> </Wix>
>
> --Curtis
>
> --
> Curtis Jewell
> swords...@csjewell.fastmail.us
>
> %DCL-E-MEM-BAD, bad memory
> -VMS-F-PDGERS, pudding between the ears
>
> [I use PC-Alpine, which deliberately does not display colors and
> pictures in HTML mail]
> --
> Curtis Jewell
> swords...@csjewell.fastmail.us
>
> %DCL-E-MEM-BAD, bad memory
> -VMS-F-PDGERS, pudding between the ears
>
> [I use PC-Alpine, which deliberately does not display colors and pictures in 
> HTML mail]
>
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>   

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to