1
votes

I am writing an inno setup installer for my app. I want this installer to function both as a full installer and as an update depending on this if my app is already installed.

I was able to create an "update" installation with inno setup that will replace old files if my app is already installed. If not, it will just do a full install.

Problem is with uninstall key in Windows. Inno setup creates one uninstall key for every installation. So if I do an update there will be two uninstall keys for my app. If I disable creation of uninstall keys then the full install will not create it.

Can CreateUninstallRegKey and UpdateUninstallLogAppName be turned off in runtime?

1
You are mistaken. If the setups have the same AppID then they will be the same installation and have the same uninstall entry. I assume from your comments about the upgrading that they shared the same AppID. See this article for more details.Deanna

1 Answers

5
votes

If there is a reasonably small difference in size between your full install and your update install (which is usually the case), then you should make both actually be the exact same installer.

The simplest (and most reliable) way to do this is to ensure that you set a single AppId (if you already have some out in the field where you failed to do this, then set the AppId to the same value as the existing AppName).

Next, check your [Files] entries; make sure that the appropriate Flags are specified on all files. (As a general rule, files installed to {app} should typically have "ignoreversion"; user-editable files should have "onlyifdoesntexist"; shared libraries should have "replacesameversion sharedfile", but you may need something different in specific cases.)

Then simply set DisableDirPage=auto and DisableProgramGroupPage=auto (and leave everything else at defaults), and Inno will automatically skip the directory and Start Menu selection pages for upgrades, using the values entered during the original installation. No mess, no fuss.