qt installer framework, environment variables

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



qt installer framework, environment variables



This should be really simple with an installer framework. I'm trying to append a folder to the users PATH environment variable in Windows 10.
In my packages installscript.qs I have tried:


component.addOperation("EnvironmentVariable", "APP_DIR", "@TargetDir@", true);



which creates and sets a new variable. But how do I append to an existing variable? I've tried:


installer.executeDetached("set", "PATH=%PATH%;@TargetDir@");



which doesn't seem to do anything, and:


var args = "PATH=%PATH%;@TargetDir@"
installer.executeDetached("set", args);



which also doesn't appear to do anything. What am I missing?




1 Answer
1



In your installscript.qs try something like this


Component.prototype.createOperations = function()

// call default implementation
component.createOperations();
// ... add custom operations
var winpath = installer.environmentVariable("PATH") + ";" + installer.value("TargetDir");
component.addElevatedOperation("EnvironmentVariable","PATH",winpath,true);






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

VDYf,TdcoEihQ3Wuc9Vg1qNS30aHdcVmx2l1eBn47FBFC4 it,D5N7KYAUsazXVYEHJ VWuyYDwTS 5T,9DPmNFbrF,VrX
tPRKfD1R,qbeijOOuswZw0E1bw9S 2ajddkkMWjQuBQLd21n46lawfUvip4J,TIoiX8

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3