On 11/01/2022 19:16, Sam Oxigen wrote:
> I was hopping to see other solution ;), as I mentioned, "/uninstall
> first/" is a requirement for a silent install scenario.
> This is an explanation from our product manager:
> /First: We a have power shell scripts to collect all required
> files/folders- to copy over inno installer content directory, and
> compile inno scripts to an executable./
> "We won't modify inno script/project file(s) with every update. We want
> to make sure that we re-install the product with no left over files from
> previews installations, also preserving some config/database files
> installed or generated during the initial installation."
At that point, you bounce the requirement back and tell them why they're
wrong. You don't implement something silly just because they don't know
what they're actually asking for.
Or you get creative with ISPP to read their scripts/files and do the
right thing even if they won't.
> That said, I had to stick with this design pattern, and I worked around
> the issue:
> I move my "delete/preserve" files/folders logic to
> *DeinitializeUninstall* built-in event procedure (Called just before
> uninstall terminates).
That is completely incorrect. If you really must do some conditional
uninstall logic, do it in CurUninstallStepChanged(usUninstall) (or in
rarer cases usPostUninstall).
But it is still inappropriate for an upgrade to run the uninstall in the
first place.