Removing uninstall entry without removing the app in Squirrel.Windows installer

1k views Asked by At

I am using Squirrel installer inside an MSI installer. MSI installer invokes the Squirrel installer. Since MSI installer will have the entry in Add/Remove programs, I want to remove (or not create) the entry created by the Squirrel installer.

What I did was to use RemoveUninstallerRegistryEntry in the event handler for onFirstRun, but it is giving me following error:

Couldn't write uninstall icon, don't care: System.IO.IOException: Illegal operation attempted on a registry key that has been marked for deletion.

Based on this error, I feel I am removing uninstaller entry at a wrong place. What should be the place to remove the uninstall entry? Or is there a way to stop Squirrel from creating these entries in the first place?

2

There are 2 answers

4
Christopher Painter On

IMO, your creating a "trojan" MSI. You can set the ARPSYSTEMCOMPONENT property in the MSI and it won't display in Add Remove Programs. But honestly, you probably don't want MSI to register it self with the system at all. In that case remove certain key standard actions from your installer such as PublishComponents, PublishFeatures and PublishProduct.

0
Alexander On

Whether you should do this or not, you can modify Squirrel so it never creates the registry entries. Just comment out either the calls to CreateUninstallerRegistryEntry or comment out the function in this file. It's easy enough to just rebuild squirrel and replace the reference to the one from nuget with your custom version.
As long as you're bootstrapping squirrel with a larger part of your application, I don't see any problem with doing this.