From f6e44564ff90e79267b2312d3b1c729f9efec328 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 24 Jan 2024 15:46:56 +0200 Subject: [PATCH] Fix script compatibility. --- winsetup.qbs | 147 +++++++++++++++++++++++++-------------------------- 1 file changed, 72 insertions(+), 75 deletions(-) diff --git a/winsetup.qbs b/winsetup.qbs index 68d2b4845..4c528b0ca 100644 --- a/winsetup.qbs +++ b/winsetup.qbs @@ -2,82 +2,79 @@ import qbs.FileInfo import qbs.Utilities import qbs.TemporaryDir -Project { - InnoSetup { - Depends { name: "buildconfig" } +InnoSetup { + Depends { name: "buildconfig" } - property bool _test: { - var present = qbs.targetOS.includes("windows") && innosetup.present; - console.info("has innosetup: " + present); - if (present) { - console.info("innosetup version " + innosetup.version); - } - } - - condition: qbs.targetOS.contains("windows") - name: "ValentinaSetup" - targetName: "ValentinaInstaller" - version: buildconfig.projectVersion - builtByDefault: false - - files: [ - project.sourceDirectory + "/dist/win/inno/valentina.iss" - ] - - property string arhitecture: { - if (qbs.architecture == "x86_64") - { - return "x64" - } - - if (qbs.architecture == "arm64") - { - return "arm64"; - } - - return ""; - } - - property string minVersion: { - if (Utilities.versionCompare(Qt.core.version, "6.5") >= 0) - { - return "10.0.17763"; - } - - if (Utilities.versionCompare(Qt.core.version, "6.3") >= 0) - { - return "10.0.19044"; - } - - if (Utilities.versionCompare(Qt.core.version, "6.2") >= 0) - { - return "10.0.17763"; - } - - if (Utilities.versionCompare(Qt.core.version, "6.0") >= 0) - { - return "10.0"; - } - - return "6.1"; - - } - - innosetup.verboseOutput: true - innosetup.defines: [ - "MyAppVersion=" + version, - "MyAppCopyright=" + buildconfig.valentina_copyright_string, - "MyAppArchitecture=" + arhitecture, - "MyAppMinWinVersion=" + minVersion, - "buildDirectory=" + project.qbs.installRoot - ] - innosetup.compilerFlags: ["/V9"] - - Group { - fileTagsFilter: ['innosetup.exe'] - qbs.install: true - qbs.installPrefix: '/' + property bool _test: { + var present = qbs.targetOS.contains("windows") && innosetup.present; + console.info("has innosetup: " + present); + if (present) { + console.info("innosetup version " + innosetup.version); } } -} + condition: qbs.targetOS.contains("windows") + name: "ValentinaSetup" + targetName: "ValentinaInstaller" + version: buildconfig.projectVersion + builtByDefault: false + + files: [ + project.sourceDirectory + "/dist/win/inno/valentina.iss" + ] + + property string arhitecture: { + if (qbs.architecture == "x86_64") + { + return "x64" + } + + if (qbs.architecture == "arm64") + { + return "arm64"; + } + + return ""; + } + + property string minVersion: { + if (Utilities.versionCompare(Qt.core.version, "6.5") >= 0) + { + return "10.0.17763"; + } + + if (Utilities.versionCompare(Qt.core.version, "6.3") >= 0) + { + return "10.0.19044"; + } + + if (Utilities.versionCompare(Qt.core.version, "6.2") >= 0) + { + return "10.0.17763"; + } + + if (Utilities.versionCompare(Qt.core.version, "6.0") >= 0) + { + return "10.0"; + } + + return "6.1"; + + } + + innosetup.verboseOutput: true + innosetup.defines: [ + "MyAppVersion=" + version, + "MyAppCopyright=" + buildconfig.valentina_copyright_string, + "MyAppArchitecture=" + arhitecture, + "MyAppMinWinVersion=" + minVersion, + "buildDirectory=" + project.qbs.installRoot + ] + innosetup.compilerFlags: ["/V9"] + + Group { + fileTagsFilter: ['innosetup.exe'] + qbs.install: true + qbs.installPrefix: '/' + } +}