I am writing a WiX installer for an application that has been deployed previously using ClickOnce.
I would like to determine if the application is installed on the client computer and abort the MSI installation. I searched for similar questions in Stack Overflow, but couldn't find a way to do this.
If I can find the path or any registry key that tells me where the application was installed, I can abort the MSI installation using the condition.
Using the answer for this question , I was able to get somewhere. ClickOnce shortcuts are files with the .appref-ms extension . This is the code I'm using:
<Property Id="APP_CLICKONCE_INSTALLED">
<DirectorySearch Id="dirSearch.APP.CLICKONCE" AssignToProperty="yes" Path="[StartMenuFolder]" Depth="2">
<FileSearch Id="fileSearch.APP.CLICKONCE" Name="APP.appref-ms" />
</DirectorySearch>
</Property>
<Condition Message="App is already installed. Please uninstall it then re-run this setup.">
<![CDATA[APP_CLICKONCE_INSTALLED = "" OR INSTALLED]]>
</Condition>
StartMenuFolder AllUsers, . .
perUser StartMenuFolder ( perMachine):
<Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" />
.