aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/nsis
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2013-10-31 15:59:15 -0400
committerJoerg Bornemann <joerg.bornemann@digia.com>2013-11-04 13:57:52 +0100
commitf60369a9cc94f934c7814fbd9fa90155434c5578 (patch)
tree1b9778813771a32cbeb0b5de9e0f4b1213df8112 /share/qbs/modules/nsis
parent2ce35b8d9d3f33be3039956812ac7b25b459f83f (diff)
Improve the way that the NSIS installation is found.
Now that we have registry access, we search the registry for the known key and then determine the NSIS installation path and version number from that. The latter is now available as a set of properties. This searching code is also now not broken for 32-bit Windows... Task-number: QBS-414 Change-Id: I93a0e35084d11b3b0664bfa67bea29eb72a96380 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'share/qbs/modules/nsis')
-rwxr-xr-xshare/qbs/modules/nsis/NSISModule.qbs27
1 files changed, 17 insertions, 10 deletions
diff --git a/share/qbs/modules/nsis/NSISModule.qbs b/share/qbs/modules/nsis/NSISModule.qbs
index 0b126c3e6..3cd2b919f 100755
--- a/share/qbs/modules/nsis/NSISModule.qbs
+++ b/share/qbs/modules/nsis/NSISModule.qbs
@@ -6,16 +6,14 @@ import "../utils.js" as ModUtils
Module {
condition: qbs.hostOS.contains("windows") && qbs.targetOS.contains("windows")
- property path toolchainInstallPath: {
- // First try the registry key...
- // HKLM\\SOFTWARE\\Wow6432Node\\NSIS\\(default),VersionMajor,VersionMinor,VersionBuild,VersionRevision
- // HKLM\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\\DisplayVersion
-
- // Then try the known default filesystem path
- var path = FileInfo.joinPaths(qbs.getenv("PROGRAMFILES(X86)"), "NSIS");
- if (File.exists(path))
- return path;
- }
+ property path toolchainInstallPath: getNativeSetting(registryKey)
+
+ property string version: versionMajor + "." + versionMinor
+ property var versionParts: [ versionMajor, versionMinor, versionPatch, versionBuild ]
+ property int versionMajor: getNativeSetting(registryKey, "VersionMajor")
+ property int versionMinor: getNativeSetting(registryKey, "VersionMinor")
+ property int versionPatch: getNativeSetting(registryKey, "VersionPatch")
+ property int versionBuild: getNativeSetting(registryKey, "VersionRevision")
property string compilerName: "makensis.exe"
property string compilerPath: compilerName
@@ -59,6 +57,15 @@ Module {
property string executableSuffix: ".exe"
+ // Private properties
+ property string registryKey: {
+ var keys = [ "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS" ];
+ for (var i in keys) {
+ if (getNativeSetting(keys[i]))
+ return keys[i];
+ }
+ }
+
validate: {
if (!toolchainInstallPath)
throw "nsis.toolchainInstallPath is not defined. Set nsis.toolchainInstallPath in your profile.";