Is there any way to use runasoriginaluser in uninstallrun in inno setup? - virtualbox

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?

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.

Related

Intel Vtune Profiler: Remote Profiling with Sudo

I'm using Intel Vtune to profile a remote application that requires sudo access on another machine. I have been able to profile remote applications on that machine before that do not require sudo access, but Intel Vtune is not working for applications that require sudo access. I tried two different approaches:
I called the application with sudo pre-appended in the vtune app.
This attempted solution didn't even run and gave me an error.
I created a bash script that called the application with sudo pre-appended inside the script. I also disabled password to escalate permissions to superuser, so that the script won't prompt for a password.
Vtune ran this attempt and did not return an error, but it didn't really work. When analyzing the results it ran for less than 1 second (the application is supposed to run for a few mins), and it didn't even capture enough data to give me any information. It obviously didn't run properly, but I didn't see any errors or warnings so I can't really tell what is going on.
Any ideas on how to properly run remote applications with sudo permissions in Vtune?
For your case you should be actually using sudo for the application and should be giving your actual application and parameters to it in the parameters field. Please find an attached image as example.
This is because you are passing your app to sudo executable which takes in your app as parameter and executes required action.
Your second example did not work as the bash file might have sudo dependencies and would work only if this is executed with sudo/root. A normal execution(by a normal user) might not even run the bash script.

Qt Installer Framework, installer crashes when having multiple elevated operations

This is the first app that I'm trying to deploy.
I need the installer to establish a symlink with one of the installed files as well as adding the user to a different group. I'm currently using component.addElevatedOperation("CreateLink", <linkPath>, <targetPath>) and component.addElevatedOperation("Execute", "usermod -a -G dialout id")
to accomplish this.
The installer builds successfully with the IFW's binarycreator.
The problem occurs when running the installer. If I try to install the component containing these operation, the installer freezes. It freezes right after I've entered the sudo password. How do I get the installer to successfully run these commands?

ColdFusion 10 Mandatory Update install fails on VM

I need to run the mandatory update for ColdFusion 10 so I can apply the later updates to the server. I downloaded the file and tried the instructions listed here: Mandatory Update Instructions.
I have a singular instance, so this should be fairly straightforward. I download the file, place it in the "hf-updates" folder, and then do java -jar cf10_man_updt.jar and I get the following notice:
Graphical installers are not supported by the VM. The console mode
will be used instead...
The installer proceeds to hang and fails to complete. I then go to option #2: Silent mode. I create my properties file and then do java -jar cf10_mdt_updt.jar -i silent -f install.cfg.txt. I get the following message:
Installer User Interface Mode Not Supported
Unable to load and to prepare the installer in console or silent mode.
This one has the courtesy to actually terminate so I don't have to close the command prompt window to retry, but I'm still nowhere. Any ideas on what I can do?
Alex provided the correct answer. I had been using the JRE in my program files folder (explicitly, actually. There was no javapath to speak of in the environment variables. I shorthanded the command for the sake of brevity). I changed the command to "C:\Coldfusion10\cfusion\jre\bin\java" -jar cf10_mdt_updt.jar and the install ran successfully.

Jenkins can't copy files to windows remote host

I have a Jenkins server on OS X 10.7, which polls a subversion server, builds the code and packages the app. The last step that I need to complete is deploying the app on a remote host, which is a windows share. Note that my domain account has write access to the target folder and the volume is mounted. I've tried using a shell script build step:
sudo cp "path/to/app" "/Volumes/path/to/target"
However i get a "no tty" response. I was able to run this command succesfully in Terminal, but not as a build step in Jenkins.
Does this have something to do with the user being used when starting up Jenkins? As a side note, the default user.name is jenkins and my JENKINS_HOME resides in /Users/Shared/Jenkins. I would appreciate any help as to how to achieve this.
Your immediate problem seems to be that you are running Jenkins in the background and sudo wants to input a password. Run Jenkins in the foreground with $ java -jar jenkins.war.
However, this most probably won't solve your problem as you'll be asked to enter a password when the command runs - from the terminal you started Jenkins from (presumably it's not what you want). You need to find a way to copy your files without needing root permissions. In general, it it not a good idea to rely on administrative permissions in your builds (there are exceptions, but your case is not it).

Understanding fabric

I've just stumbled upon Fabric and the documentation doesn't really make it obvious how it works.
My educated guess is that you need to install it on both client-side and server-side. The Python code is stored on the client side and transferred through Fabric's wire-protocol when the command is run. The server accepts connections using the OpenSSH SSH daemon through the ~/.ssh/authorized_keys file for the current user (or a special user, or specified in the host name to the fab command).
Is any of this correct? If not, how does it work?
From the docs:
Fabric is a Python (2.5 or higher) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.
It provides a basic suite of operations for executing local or remote shell commands (normally or via sudo) and uploading/downloading files, as well as auxiliary functionality such as prompting the running user for input, or aborting execution.
So it's just like ssh'ing into a box and running the commands you've put into run()/sudo().
There is no transfer of code, so you only need to have ssh running on the remote machine and have some sort of shell (bash is assumed by default).
If you want remote access to a python interpreter you're more looking at something like execnet.
If you want more information on how execution on the remote machine(s) work look to this section of the docs.
Most what you are saying is correct, except that the "fabfile.py" file only has to be stored on your client. An SSH server like OpenSSH needs to be installed on your server and an SSH client needs to be installed on your client.
Fabric then logs into one or more servers in turn and executes the shell commands defined in "fabfile.py". If you are located in the same dir as "fabfile.py" you can go "fab --list" to see a list of available commands and then "fab [COMMAND_NAME]" to execute a command.
The user on the server does not need to be added to "~/.ssh/authorized_keys" but if it is you don't have to type the password every time you want to execute a command.