Skip to content

Commit

Permalink
installer: get uid and gid only for macos
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jkito committed Nov 11, 2024
1 parent b62f9ca commit 57c7bc8
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,31 @@ 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()) {
console.log("Checking for existing installation")
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") {
Expand Down

0 comments on commit 57c7bc8

Please sign in to comment.