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).