Hello everybody.
NSIS 2.51
When I run: ExecWait '"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm my_vm'
it works.
When I run: ExecWait '"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list vms'
It doesn't work.
If I run both strings in MS Windows command line , both of them work just fine.
What is the difference?
Thank you.
NSIS and VBoxManage.exe
17 posts
And doesn't work means what exactly? If this command writes to stdout and you want that output you need to use nsExec or one of the other "DOS" exec plugins...
!include x64.nsh
${DisableX64FSRedirection}
Or use the ExecDos plug-in with the /disablefsr switch.
Stu
${DisableX64FSRedirection}
Or use the ExecDos plug-in with the /disablefsr switch.
Stu
How could WOW64 redirection be the issue if the first command worked correctlyOriginally Posted by Afrow UK View Post!include x64.nsh
${DisableX64FSRedirection}
Or use the ExecDos plug-in with the /disablefsr switch.
Perhaps he is running the 2nd command from a page callback and has only disabled redirection in a Section. VirtualBox is a 64-bit install on 64-bit Windows so it's good to cover all bases and the user may not have disabled redirection at all (and is testing on a 32-bit OS) 🙂
Stu
Stu
Thank you for your respond.
In my first example :ExecWait '"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm my_vm' it sends the command to VM and I can see in the terminal windows how the command was executed.
In my second example :ExecWait '"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list vms'
it does nothing. It just opens the terminal window and waits for a few second and exits. It doesn't list VMS.
In my first example :ExecWait '"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm my_vm' it sends the command to VM and I can see in the terminal windows how the command was executed.
In my second example :ExecWait '"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list vms'
it does nothing. It just opens the terminal window and waits for a few second and exits. It doesn't list VMS.
It didn't help to solve the problem.Originally Posted by Afrow UK View Post!include x64.nsh
${DisableX64FSRedirection}
Or use the ExecDos plug-in with the /disablefsr switch.
Stu
When I need to run : list vms, I have to use the following :
ExecWait 'cmd.exe /k "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list vms'
I had to add cmd.exe, because it didn't work without it.
But if I run:
ExecWait 'cmd.exe /k "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list runningvms'
It still doesn't return anything.
ExecWait 'cmd.exe /k "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list vms'
I had to add cmd.exe, because it didn't work without it.
But if I run:
ExecWait 'cmd.exe /k "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list runningvms'
It still doesn't return anything.
Do you get any output using nsExec?
Stu
Stu
There is no output using nsExec.
Section
nsExec::ExecToLog '"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list vms'
Pop $0
SectionEnd works for me on 64-bit Windows 8.Hardcoding ProgramFiles like this is of course not something you should do!
It works if I run it directly in MS Windows cmd:
C:\Program Files\Oracle\VirtualBox>VboxManage list runningvms
"rnd" {cf185132-d834-4f3e897c6aa3811b9972}
But it still doesn't work with NSIS:
ExecWait 'cmd.exe /k "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list runningvms'
C:\Program Files\Oracle\VirtualBox>VboxManage list runningvms
"rnd" {cf185132-d834-4f3e897c6aa3811b9972}
But it still doesn't work with NSIS:
ExecWait 'cmd.exe /k "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list runningvms'
Please try to do the same but for: list runningvmsOriginally Posted by Anders View Postworks for me on 64-bit Windows 8.Section nsExec::ExecToLog '"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list vms' Pop $0 SectionEnd
Hardcoding ProgramFiles like this is of course not something you should do!
It works for : list vmsOriginally Posted by butsay View PostPlease try to do the same but for: list runningvms
but it doesn't work for: list runningvms
When I run the command:
nsExec::ExecToLog 'cmd.exe /k "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" guestcontrol rnd --username root --password ******* run .........
I've got this output:
VBoxManage.exe: error: Machine "rnd" is not running (currently powered off)!
D:\VirtualBox>
Completed
So the problem is that the state of the virtual machine is not detected.
And this is why I can't get anything from the command : list runningvms
My questions is what should I do to detect properly the state of the virtual machine in NSIS?
It works just fine in the MS command line window.
nsExec::ExecToLog 'cmd.exe /k "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" guestcontrol rnd --username root --password ******* run .........
I've got this output:
VBoxManage.exe: error: Machine "rnd" is not running (currently powered off)!
D:\VirtualBox>
Completed
So the problem is that the state of the virtual machine is not detected.
And this is why I can't get anything from the command : list runningvms
My questions is what should I do to detect properly the state of the virtual machine in NSIS?
It works just fine in the MS command line window.
Does your installer request UAC elevation? I think I read something about VBox not listing VMs for other users and possibly other logon sessions.
No, my installer doesn't request UAC elevation.
Unfortunately NSIS doesn't work properly with VboxManage.exe
I was able to run all my commands with Vboxmanage using bat file but not the ExecWait, ExecDos e.t.c.
Unfortunately NSIS doesn't work properly with VboxManage.exe
I was able to run all my commands with Vboxmanage using bat file but not the ExecWait, ExecDos e.t.c.