Qt Installer Framework and Administrator privileges [SOLVED]
-
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
-
Hi everyone, i dont know if this question is already discussed but i did not find relatable.
So my question is i am developing a QT application to initialize the SSD (Solid state drives). So the flow of the application is like that........ when i run the application it checks how many drives are connected..... If i run it as administrator it find the connected drive but when i do not run it as administrator then it cant fetch the connected drive so i want to change in my application that it will not ask me for the administrative username and password.
Is there any way to do it -
@Darshan_NewBee said in Qt Installer Framework and Administrator privileges [SOLVED]:
it checks how many drives are connected
How? Please provide more details...
-
@jsulm So there is DLL that have API's to get that information like number of drives, drive details etc. So this is very known that if you want to fetch the drive details from any platform or any user section it will ask you for administrator credentials to look into it . So i want that it will not ask me for that credentials or it ask me in the time of installation only and later on it simply run with admin privileges,
Is it possible? -
@Darshan_NewBee said in Qt Installer Framework and Administrator privileges [SOLVED]:
So there is DLL that have API's
What library is it?
-
@jsulm That is opal library. Actually i am in hurry to get the solution can you please tell me what should i do for that.
-
@Darshan_NewBee said in Qt Installer Framework and Administrator privileges [SOLVED]:
can you please tell me what should i do for that
No, I don't know what this opal library is (you could post a link at least). Did you try to find something in the documentation of that library? Get some support from the authors? You are asking in a Qt forum about something which is not part of Qt.
-
@jsulm Sorry for that but i cant share you the link or more about it because its confidential and our clients dosent want to disclose it . I think there is nothing to tell about the DLL and relevant for my question .So is there any way to bypass the UAC prompt that ask for administrator credentials