Is there a way to uninstall previous version?¿

557 views
Skip to first unread message

Profi Làctic

unread,
Sep 20, 2021, 3:30:48 AM9/20/21
to innosetup
Hi,

I have an installable but i need to change the installation folder. So with my installation i need to uninstall previous version without the client intervention. Is there any way to handle this with inno setup?¿ Thanks in advice!!

Profi Làctic

unread,
Sep 20, 2021, 3:50:55 AM9/20/21
to innosetup

Profi Làctic

unread,
Sep 20, 2021, 9:40:52 AM9/20/21
to innosetup
Can't get it working as this only replaces the current installation, i need to acces the installation and uninstall it to install to another directory (for example, standard installation are in C/programFiles or D/programFiles, but i need to install the new version into appdata folder for permisions and want to uninstall the version from disk).

Gavin Lambert

unread,
Sep 20, 2021, 7:13:14 PM9/20/21
to inno...@googlegroups.com
On 21/09/2021 1:40 am, Profi Làctic wrote:
> Can't get it working as this only replaces the current installation, i
> need to acces the installation and uninstall it to install to another
> directory (for example, standard installation are in C/programFiles or
> D/programFiles).

The procedure is the same.

You may need to use the old AppId instead of using SetupSetting in case
you changed it. You may also need to adjust things depending on whether
you're installing in 64-bit mode or not (or if that's different between
your old and new installers.)

Also these days it's better to run that code from PrepareToInstall
instead of CurStepChanged(ssInstall), though both will work.

> but i need to install the new version into appdata
> folder for permisions and want to uninstall the version from disk

This sounds like you're doing the wrong thing.

You should never install applications into AppData, except specifically
to {userpf} and that only when using PrivilegesRequired=lowest.

Installing apps with PrivilegesRequired=admin and into {pf} is the
correct thing to do in almost all cases. If this causes permissions
problems for your app, this is a bug in your app (you're probably trying
to write files in the app directory instead of in AppData, which you
need to fix).
Reply all
Reply to author
Forward
0 new messages