Skip to content
Snippets Groups Projects
Commit 57c7bc86 authored by jkito's avatar jkito :skull:
Browse files

installer: get uid and gid only for macos

to set the required ownership for the bitmask-helper
unix socket we need to fetch the uid and gid of  the
user during installation, this information is  given
by the `id` command and it is needed only on macos

this fixes a bug on windows where installation fails
due to missing the `id` executable on windows
parent b62f9ca1
No related branches found
No related tags found
1 merge request!270installer: get uid and gid only for macos
Pipeline #250362 passed
......@@ -33,21 +33,21 @@ function cancelInstaller(message)
}
function Component() {
// Check whether OS is supported.
// start installer with -v to see debug output
var uid = installer.execute("/usr/bin/id", ["-u"])[0]
var gid = installer.execute("/usr/bin/id", ["-g"])[0]
if (systemInfo.productType === "macos") {
var uid = installer.execute("/usr/bin/id", ["-u"])[0]
var gid = installer.execute("/usr/bin/id", ["-g"])[0]
installer.setValue("HelperSocketUid", uid.trim())
installer.setValue("HelperSocketGid", gid.trim())
installer.setValue("HelperSocketUid", uid.trim())
installer.setValue("HelperSocketGid", gid.trim())
console.log("UID: " + uid)
console.log("GID: " + gid)
}
installer.gainAdminRights();
console.log("OS: " + systemInfo.productType);
console.log("Kernel: " + systemInfo.kernelType + "/" + systemInfo.kernelVersion);
console.log("UID: " + uid)
console.log("GID: " + gid)
installer.setDefaultPageVisible(QInstaller.TargetDirectory, false);
if (installer.isInstaller()) {
......@@ -55,6 +55,9 @@ function Component() {
component.loaded.connect(this, Component.prototype.installerLoaded);
}
// Check whether OS is supported.
// start installer with -v to see debug output
var validOs = false;
if (systemInfo.kernelType === "winnt") {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment