Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Installer Framework -- install for non-admin user
Forum Updated to NodeBB v4.3 + New Features

Qt Installer Framework -- install for non-admin user

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
1 Posts 1 Posters 452 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    panosk
    wrote on last edited by
    #1

    Hello,

    I'm trying to figure how to install my application under a local non-admin user on Windows. If the user is also an admin, all works fine. Otherwise, the user paths are messed, the application entry is not added to Add/Remove Programs, and generally the installation is problematic. Here is my config:

    <?xml version="1.0" encoding="UTF-8"?>
    <Installer>
        <Name>MyApp</Name>
        <Version>1.0.1</Version>
        <Title>MyApp Installer</Title>
        <Publisher>MyCompany</Publisher>
        <StartMenuDir>MyApp</StartMenuDir>
        <TargetDir>@ApplicationsDirX64@/MyCompany</TargetDir>
    	<InstallerWindowIcon>installericon</InstallerWindowIcon>
    	<InstallerApplicationIcon>icon</InstallerApplicationIcon>
    	<Logo>logo.png</Logo>
    	<WizardStyle>Modern</WizardStyle>
    	<WizardDefaultWidth>820</WizardDefaultWidth>
    	<WizardDefaultHeight>440</WizardDefaultHeight>
    </Installer>
    

    And here is the script:

    function Component()
    {
        // default constructor
    }
    
    Component.prototype.createOperations = function()
    {
        component.createOperations();
    	if (systemInfo.productType === "windows") {
            component.addOperation("CreateShortcut", "@TargetDir@\\MyApp.exe", "@StartMenuDir@\\MyApp.lnk",
                "workingDirectory=@TargetDir@", "iconPath=@TargetDir@\\MyApp.exe",
                "iconId=0", "description=MyApp");
    		var createDir = ["cmd","/c","mkdir","%HOMEDRIVE%%HOMEPATH%\\AppData\\Roaming\\MyCompany\\MyApp"];
    		var deleteDir = ["cmd","/c","rmdir","%HOMEDRIVE%%HOMEPATH%\\AppData\\Roaming\\MyCompany\\MyApp","/s","/q"];
    		component.addOperation("Execute",createDir,"UNDOEXECUTE",deleteDir);
    		
    		var regargs1 = ["cmd","/c","reg add","HKEY_CURRENT_USER\\Software\\MyCompany\\MyApp"];
    		var regargs2 = ["cmd","/c","reg delete","HKEY_CURRENT_USER\\Software\\MyCompany\\MyApp","/f"];
    		component.addOperation("Execute",regargs1,"UNDOEXECUTE",regargs2);
    		component.addOperation("Execute", "{0,3010,1638,5100}", "@TargetDir@\\vc_redist.x64.exe", "/quiet", "/norestart");
    		component.addOperation("Delete", "@TargetDir@\\vc_redist.x64.exe");
    	}
    }
    

    Any help will be greatly appreciated!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved