0

I am using WIX installer for my application everything working fine but when I uninstall the application the desktop icon and startmenu icon is still there. Whats wrong with my xml. followed the steps given by Wix documentation. help..

XML:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="applicationName" Language="1033" Version="1.0.0.0" Manufacturer="manufacturerName" UpgradeCode="PUT-GUID-HERE">
    <Package Id="*" InstallerVersion="201" Compressed="yes" InstallScope="perMachine" Comments="Windows Installer Package" ReadOnly="yes" InstallPrivileges="elevated" />       
    <Feature Id="ProductFeature" Title="applicationName" Level="1">         
        <ComponentRef Id="Permission.INSTALLFOLDER" />
        <ComponentRef Id="ApplicationDeskShortcutComp" />
        <ComponentGroupRef Id="HeatGenerated" />
    </Feature>      
    <Media Id="1" Cabinet="cab1.cab" EmbedCab="yes" />
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFiles64Folder">
            <Directory Id="CompanyNameFolder" Name="CompanyName">
                <Directory Id="INSTALLFOLDER" Name="applicationName">
                    <Component Id="Permission.INSTALLFOLDER" Guid="*">
                        <CreateFolder>
                            <Permission User="Everyone" GenericAll="yes" />
                        </CreateFolder>
                    </Component>                        
                </Directory>
            </Directory>
        </Directory>
        <Directory Id="DesktopFolder" Name="applicationName" />         
    </Directory>

    </DirectoryRef>-->
    <!--Add the shortcut to installer package For DeskTop-->
    <DirectoryRef Id="DesktopFolder">
        <Component Id="ApplicationDeskShortcutComp" Guid="*" Win64="yes" >
            <Shortcut Id="ApplicationDeskShortcut" Name="applicationName" Description="applicationName" Target="[INSTALLFOLDER]exeName.exe" WorkingDirectory="DesktopFolder" Icon="IconName.exe" >
            </Shortcut> 
            <RemoveFolder Id="DesktopFolder" On="uninstall" />              
            <RegistryValue Root="HKCU" Key="Software\Manufacturer\ProductName" Name="installed" Type="integer" Value="1" KeyPath="yes" />
        </Component>
    </DirectoryRef>

    <Property Id="MYWIXUI_MONDO" Value="INSTALLFOLDER" />
    <UIRef Id="MyWixUI_Mondo" />
    <Icon Id="IconName.exe" SourceFile=".\Icons\MainLogo.ico" />
    <Property Id="ARPPRODUCTICON" Value="IconName.exe" />
   </Wix>
hoshi
  • 11
  • 3
  • `` is wrong. You certainly don't want to delete the desktop folder of the user. This may already cause the component uninstall to fail, so the desktop shortcut stays there. – zett42 Jul 27 '18 at 09:02
  • @zett42 Nope i have already checked it, that's not the problem. thanks for the reply. – hoshi Jul 27 '18 at 09:20
  • Create a verbose log by running this command-line: `msiexec -x {ProductCode} -l*v logfile.txt` (obviously replace {ProductCode} by actual product code). Search for `InstallValidate` in the log. There should be a line containing `Component: ApplicationDeskShortcutComp; Installed: Local; Request: Absent; Action: Absent`, similar for start menu shortcut. – zett42 Jul 27 '18 at 09:47
  • [How to find ProductCode of an installed application](https://stackoverflow.com/q/5063129/7571258) – zett42 Jul 27 '18 at 09:51
  • @zett42 No there is no entry for ApplicationDeskShortcutComp in logfile. "InstallValidate. Return value 1." – hoshi Jul 27 '18 at 10:06
  • The component states usually get listed a few lines after `InstallValidate`. There must be a mentioning of the component ID somewhere in the log, except if the uninstall failed very early. – zett42 Jul 27 '18 at 10:14
  • `UpgradeCode="*"` is wrong. The UpgradeCode must be stable for major upgrades to work. Your script shouldn't even compile, as [UpgradeCode has type `Guid`](http://wixtoolset.org/documentation/manual/v3/xsd/wix/product.html), it would have to be `AutogenGuid` to allow `*`. – zett42 Jul 27 '18 at 10:21
  • @zett42 upgradecode is fine just for this platform i just changed it to "*". script is fine and working. – hoshi Jul 27 '18 at 10:27
  • Oh, so you have a static / hard-coded upgrade code, you just removed it from the source you pasted?`Then it is OK. Perhaps consider using the convention "PUT-GUID-HERE" instead of "*" to indicate that you have removed the GUID. If you do not have a static upgrade code, you really need to set one - as **zett42** pointed out. Will have a look at your actual question later. – Stein Åsmul Jul 27 '18 at 15:02
  • @SteinÅsmul found any solution ?? – hoshi Jul 30 '18 at 03:38
  • Haven't had much time to look at it, I wrote an answer that I deleted since I wanted to test it myself first and I don't think it is the answer. I'll undelete it so you can have a look. – Stein Åsmul Jul 30 '18 at 03:46
  • Did you check all of this on a clean virtual? It is possible that you have installed two versions on top of each other, and that the component reference count is not equal to 0 on uninstall and hence the shortcuts are not uninstalled. Look in Add / Remove programs, or maybe [generate a list of installed products](https://stackoverflow.com/questions/29937568/how-can-i-find-the-product-guid-of-an-installed-msi-setup/29937569#29937569) and look for duplicates. – Stein Åsmul Jul 30 '18 at 04:08
  • [Here is another answer which discusses overlapping instances](https://stackoverflow.com/a/50283003/129130). It has a VBScript you can use to generate a comma delimited list of installed products that can be opened in Excel. I will be away for quite a few hours from now on. Best of luck. As I said before, my answer below is not relevant I think, but leaving it for now. – Stein Åsmul Jul 30 '18 at 04:15

1 Answers1

0

No time to test this right now, but could you first please try to change this:

<Directory Id="DesktopFolder" Name="applicationName" />

into this:

<Directory Id="DesktopFolder" />

DesktopFolder is a built-in Windows Installer folder that should resolve to the user's desktop folder or the common desktop folder for all users depending on the setting for ALLUSERS (per-machine or per-user installation).

During installation, MSI directory resolution (costing) will assign the correct value to DesktopFolder for the system you are running on (based on ALLUSERS setting). I thought anything you assign to DesktopFolder yourself in your WiX source would be wiped out as soon as directory resolution has run, so there is no direct logical reason why the above WiX markup change suggestion should work, but I think it should be tested. Please test on a clean virtual, if available.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • It didn't work. I also check the add/remove program list no duplication of product. Even i also try to uninstall from command prompt using product id to check for duplicate installation. NOT FOUND. – hoshi Jul 30 '18 at 04:59
  • Did you test on a clean virtual or a clean machine at least? – Stein Åsmul Jul 30 '18 at 23:28