1

I have written an application using docker-toolbox and inno setup script for the application installation in windows 10.

And I want to remove the docker-toolbox VM, while I uninstall my program. However, the VM cannot remove completely by following inno setup script.

[Setup]
PrivilegesRequired=none

[UninstallRun]
Filename: "{cmd}"; Parameters: "/C ""docker-machine rm -y myDocker"""

The command "docker-machine rm -y myDocker" always work whenever runs in my user cmd, but not works in inno setup uninstallrun.

And I checked and found out that docker-toolbox is based on VirtualBox. VirtualBox uses a per-user environment. Becoming root (or any other user) does not give you access or more powers to the original user's VMs. ALWAYS perform VM operations as the user that actually created the VMs. Hence, I have to run a command as a original user in uninstallrun, but I cannot find a way to do so.

Looking forward for a help and support, I have spent lots of times in this problem.
Is there any way to use runasoriginaluser in uninstallrun in inno setup?

Chun To Lam
  • 129
  • 1
  • 1
  • 4

1 Answers1

1

You should not modify a specific user profile from an (un)installer that runs with Administrator privileges (installs software for all users).

See Installing application for currently logged in user from Inno Setup installer running as Administrator.


runasoriginaluser flag is not supported in UninstallRun section. Probably because it won't be of any use there anyway. What the flag does in Run section is that it executes program with privileges with which the installer was originally executed. But uninstaller (for installer elevated to Administrator privileges) is executed with Administrator privileges straight away, when executed from Control Panel/Settings app.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992