0

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?

skjoshi
  • 2,493
  • 2
  • 27
  • 38
  • When I use `-s` flag with installer, it is going ahead and creating the uninstaller entry anyway as it is not running the first install. – skjoshi Jan 01 '17 at 14:08

2 Answers2

0

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.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • I am not creating trojan MSI, though the inner installer (Squirrel) one can be considered as trojan. I do not want to hide the MSI entry. I am trying to hide the uninstaller entry by the inner installer, as this inner installer's uninstall command will be called by the MSI uninstaller. I just want to create less confusion for user by having 2 entries for 1 install. – skjoshi Jan 03 '17 at 00:50
  • 1
    That is the definition of a trojan MSI. The inner installer are the greeks. See: https://blogs.msdn.microsoft.com/robmen/2006/02/01/google-toolbar-beta-for-enterprise-a-trojan-horse-msi-package/ – Christopher Painter Jan 03 '17 at 11:47
  • If you really want the MSI's entry in add remove programs so the MSI can invoke an uninstall and in turn call the squirrel uninstall then this really isn't an MSI question at all. MSI is behaving as expected. It's the squirrel you'd have to suppress. Out of curiosity, is your MSI per user or per machine? Is your squirrel installer the same or different? – Christopher Painter Jan 03 '17 at 11:49
  • Yes. By that definition, it will be a trojan horse.However, I think Windows Installer tag is leading to mark it as an MSI question, which it is not. I will remove that tag then. It is essentially a Squirrel.Windows question. And both of the installs are user wide and Squirrel is used to provide a quick solution for auto upgrade. – skjoshi Jan 05 '17 at 00:21
0

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.

Alexander
  • 540
  • 6
  • 12