qt installer framework, environment variables

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.

Popular posts from this blog

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

Dynamically update html content plain JS

How to determine optimal route across keyboard