Qt Installer Framework and Administrator privileges [SOLVED]
-
ECHO is on.
It was originally calling the batch file from the system32 directory so I added a call to cd and now change it to the .bat's current dir and slightly modified the folder layout and updated the batch file accordingly. This is was cmd window prints out
C:\Windows\system32>cd C:\Users\Bobby\SFC4000\
C:\Users\Bobby\SFC4000>cd ".\Driver\exi"
C:\Users\Bobby\SFC4000\Driver\exi>rundll32.exe libusb0.dll,usb_install_driver_np
_rundll sfc3000.infC:\Users\Bobby\SFC4000\Driver\exi>pause
Press any key to continue . . . -
Sorry I didn't get it. Is this the output for Installer running your batch or is this the result for Run application???
There are no errors here, if you're saying that it ran just fine when you tried it with Run then it seems we're stuck at this point!
My advice would be to check the scripts again one more time and if you are 100% sure that it just isn't working for you then try another installer creator (like inno setup) for the time being. Until new release for QTIFW comes out. -
That was the output in the command window when using your win+r instructions.
Its OK now though I finally have it working!! I applied all of the changes that you suggested and also changed the installer compatibility settings in it's properties so that it's run as administrator. I probably would have got it working much sooner if i hadn't spent an hour or so trying to install the 32bit drivers on my 64bit machine DUHHHH! But hey, we live and learn.
Thanks for your help really appreciate it :)
-
Hi, sorry to bring this post back to life, but I'm having problems executing a bundled installer from the installscript.qs in my QtInstaller application.
What I do is install the .msi to the @TargetDir@ and then try to launch it with
@component.addOperation("Execute", "msiexec.exe /i", ""@TargetDir@\MyUsbDriver.msi"");@
(I used the double quotes for the target dir because my installer application can accept paths with spaces, I'm installing on wnidows)
I keep on getting error messages stating:
bq. Execution Failed: Could not start: "C:\Program Files\MyApp\MyUsbDriver.msi" (Process failed to start: The parameter is incorrect)
(I used the double quotes for the target dir because my installer application can accept paths with spaces, I'm installing on wnidows)Any ideas on how to correctly launch the .msi file?
-
[quote author="amahta" date="1390477421"]To be precise, this is how I solved my problem because I was working on Windows and if you are also on Windows, I suggest you also do this and skip all the complications:
@
Component.prototype.createOperations = function()
{
try
{
// call the base create operations function
component.createOperations();
if (installer.value("os") === "win")
{
component.addOperation("Execute", "cmd /C "@TargetDir@\SomeFolder\SomeFile.exe"");
}
} catch (e)
{
print(e);
}
}
@
You don't need to add admin rights for this to work.
Just let the command prompt do the job for you :)[/quote]This should work for you. Pass your msi file using "msiexec" command to "cmd"
-
Using
@component.addOperation("Execute", "cmd /C", "msiexec.exe /i", ""@TargetDir@\MyUsbDriver.msi"");
@gives me the same execution error stated above.
Running the command from cmd starts the driver installation though. So it's got to be something in the installscript.qs.
Any ideas?
-
I have a related issue and am struggling to get it going for quite sometime. I have even raised a jira on Qt Installer Framework https://bugreports.qt-project.org/browse/QTIFW-497 but did not get a reply/comment yet. Any pointers would be of great help.
-
[quote author="nwoki" date="1398777153"]Using
@component.addOperation("Execute", "cmd /C", "msiexec.exe /i", ""@TargetDir@\MyUsbDriver.msi"");
@gives me the same execution error stated above.
Running the command from cmd starts the driver installation though. So it's got to be something in the installscript.qs.
Any ideas?[/quote]
Hi, I have a similar issue to this thread, and closer to that quoted above. I've looked everywhere and can find threads about executing exe's, etc AFTER installation of my own app, but need to know how to install a prerequisite for my app. This is common functionality in other installers but I can't seem to find info on it for QT Installer Framework.
I.E., I need to first run vcredist_x86.exe or my program will not work. Better yet would be detecting if they already have that or not (other advanced installer I've seen do this) and launch accordingly, but even as simple launch before we install ours would work ok too. Can this be done? -
Forgot to post my answer. This is how i resolved my problem. Basically, every parameter must be seperated as follows
@ component.addOperation("Execute"
, "msiexec"
, "/i"
, "@TargetDir@\Driver.msi"
, "UNDOEXECUTE"
, "msiexec"
, "/qb"
, "/x"
, "@TargetDir@\Driver.msi");@ -
Hello Everyone,
I hate to warm this up, but i am encountering the same problems.
I need to install some drivers along with my software, which need admin rights for installment.All together i added:
@<RequiresAdminRights>true</RequiresAdminRights> @
to the package.xml
and
@function Component()
{
}Component.prototype.createOperations = function()
{
try
{
installer.gainAdminRights();
component.createOperations();
if (installer.value("os") === "win")
{
// component.addElevatedOperation("Execute", "cmd", "/C", ""@TargetDir@\CP210xVCPInstaller_x64.exe"", "workingDirectory=@TargetDir@");
component.addElevatedOperation("Execute", "{256}", ""@TargetDir@\CP210xVCPInstaller_x64.exe"", "workingDirectory=@TargetDir@");
}
} catch (e)
{
print(e);
}
}@This returns the error:
@Error during installation process (driver_x64):
Execution failed(Unexpected exit code: 0): ""[Filepath]""@The returncode is not the issue. it does not even start the driver installation.
I tried the cmd version also, but could not get it to work either.When i manually start the installer with admin rights, it works fine.
Any advice? Thanks in advance.
-
Hi all and thanks for the hints.
I've found a problem related to admin rights so I write here instead of opening a new thread.I created a "TestInstaller" that installs a "qt hello world" program to "Program Files (86)/TestInstaller" with admin privileges.
Then if I uninstall it using admin privileges, the directory "Program Files (86)/TestInstaller" is deleted as it should.
If I uninstall it NOT using admin privileges, the directory is not deleted and still contains the file "uninstall.exe".
How can I fix this ?
-
You can't. It's a know bug bug nobody has picked it up at the moment.
-
I tried to post a thanks to nwoki the 1 October but the forum was presumably down as I could not.
Thanks.Anyway, I have other problems now: beside the logo not shown, I need to create an installer for a customer and it should NOT have admin rights.
So I wrote
<RequiresAdminRights>false</RequiresAdminRights>
in package.xml, I DON'T call
installer.gainAdminRights();
but when I execute the created installer, the admin password is asked.
Another bug or what ?
I have a Qt license, shall I contact the support ? -
@amahta said:
TargetDir
Hello All,
Actually, I have a same problem ( using 2.0.0 version), I want to use this command below:
component.addElevatedOperation("Execute", "{0,3010}", "@TargetDir@\vcredist\vcredist_x86.exe", "/norestart", "/q");
But It crashes when installing process. In my package.xml, <RequiresAdminRights>true</RequiresAdminRights> tag is exist.
Thanks in advance.
-
@amahta said in Qt Installer Framework and Administrator privileges [SOLVED]:
<RequiresAdminRights>true</RequiresAdminRights>
How to provide admin access rights or run installer.performOperation in elevated rights?
For component.addElevatedOperation("Execute", "someCommand") it works.But for controller script thid doesn't work