安装程序后,我需要安装程序将程序路径添加到 Windows 系统变量 PATH。这个怎么做?
安装人员必须这样做,而不是我。
升级版:
并且程序路径也必须通过卸载删除。
UPD2:
现在我正在尝试这样做:
function Component()
{
installer.installationFinished.connect(this, Component.prototype.installationFinishedPageIsShown);
installer.uninstallationFinished.connect(this, Component.prototype.uninstallationFinishedPageIsShown);
}
Component.prototype.installationFinishedPageIsShown = function()
{
try {
if (installer.isInstaller() && installer.status == QInstaller.Success) {
installer.executeDetached("set", "PATH=%PATH%;@TargetDir@");
}
} catch(e) {
console.log(e);
}
}
Component.prototype.uninstallationFinishedPageIsShown = function()
{
try {
if (installer.isUninstaller() && installer.status == QInstaller.Success) {
installer.executeDetached("set", "PATH=%PATH:;@TargetDir@=%");
}
} catch(e) {
console.log(e);
}
}
但它不起作用:(