-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7399 from jmarrec/Fix_7396_QtIFW_Windows
Fix #7396: Use QtIFW windows
- Loading branch information
Showing
11 changed files
with
471 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// Regular install commands to be performed | ||
function Component() | ||
{ | ||
Component.prototype.createOperations = function() | ||
{ | ||
// call default implementation | ||
component.createOperations(); | ||
|
||
// ... add custom operations | ||
|
||
var kernel = systemInfo.kernelType; | ||
if( kernel == "darwin" ) { | ||
|
||
// Chmod +x for apps | ||
component.addOperation("Execute", "chmod", "+x", "@TargetDir@/PreProcess/IDFVersionUpdater/IDFVersionUpdater.app/Contents/MacOS/IDFVersionUpdater"); | ||
component.addOperation("Execute", "chmod", "+x", "@TargetDir@/PreProcess/EP-Launch-Lite.app/Contents/MacOS/EP-Launch-Lite"); | ||
component.addOperation("Execute", "chmod", "+x", "@TargetDir@/PreProcess/EP-Launch-Lite.app/Contents/MacOS/python"); | ||
component.addOperation("Execute", "chmod", "+x", "@TargetDir@/PostProcess/EP-Compare/EP-Compare.app/Contents/MacOS/EP-Compare"); | ||
|
||
// Not sure necessary so not doing it yet | ||
// component.addOperation("Execute", "chmod", "-R", "a+w", "@TargetDir@"); | ||
// component.addOperation("Execute", "chmod", "-R", "a+w", "@TargetDir@/PreProcess/IDFVersionUpdater/IDFVersionUpdater.app/Contents/MacOS/"); | ||
// component.addOperation("Execute", "chmod", "-R", "a+w", "@TargetDir@/PreProcess/IDFVersionUpdater/"); | ||
|
||
} | ||
|
||
// On Windows | ||
if( kernel == "winnt" ) { | ||
|
||
// Create Shortcuts in the Windows Start Menu | ||
component.addOperation("CreateShortcut", "@TargetDir@/Documentation/index.html", "@StartMenuDir@/EnergyPlus Documentation.lnk"); | ||
component.addOperation("CreateShortcut", "@TargetDir@/PostProcess/EP-Compare/EP-Compare.exe", "@StartMenuDir@/EP-Compare.lnk"); | ||
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/EPDraw/EPDrawGUI.exe", "@StartMenuDir@/EPDrawGUI.lnk"); | ||
component.addOperation("CreateShortcut", "@TargetDir@/EP-Launch.exe", "@StartMenuDir@/EP-Launch.lnk"); | ||
component.addOperation("CreateShortcut", "@TargetDir@/ExampleFiles/ExampleFiles.html", "@StartMenuDir@/Example Files Summary.lnk"); | ||
component.addOperation("CreateShortcut", "@TargetDir@/ExampleFiles/ExampleFiles-ObjectsLink.html", "@StartMenuDir@/ExampleFiles Link to Objects.lnk"); | ||
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/IDFEditor/IDFEditor.exe", "@StartMenuDir@/IDFEditor.lnk"); | ||
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/IDFVersionUpdater/IDFVersionUpdater.exe", "@StartMenuDir@/IDFVersionUpdater.lnk"); | ||
component.addOperation("CreateShortcut", "@TargetDir@/readme.html", "@StartMenuDir@/Readme Notes.lnk"); | ||
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/WeatherConverter/Weather.exe", "@StartMenuDir@/Weather Statistics and Conversions.lnk"); | ||
|
||
|
||
// Note: Associate file types: done separately (optional) | ||
|
||
// Here's what stuff gets weird. We need to write stuff to the registry apparently for EP-Launch | ||
// In the registry under KEY_CURRENT_USER\Software\VB and VBA Program Settings\EP-Launch\UpdateCheck: | ||
// Name, Type, Data | ||
// AutoCheck, REG_SZ, True | ||
// CheckURL, REG_SZ, http://nrel.github.io/EnergyPlus/epupdate.htm | ||
// LastAnchor, REG_SZ, #9.1.0-mqjdfsiojf | ||
|
||
// REG ADD KeyName /v ValueName, /d Data, /f = force overwrite | ||
var reg = installer.environmentVariable("SystemRoot") + "\\System32\\reg.exe"; | ||
|
||
var keyName = "HKEY_CURRENT_USER\\Software\\VB and VBA Program Settings\\EP-Launch\\UpdateCheck"; | ||
|
||
// Note by passing arguments separately to the (reg) command in addElevatedOperation (supports up to 10 args), | ||
// Qt will escape each argument, so do not include double quote (eg: "\"AutoCheck\"") or they'll be interpreted literally | ||
// Mind the "/f" flag which avoids displaying a [Yes/No] prompt that you | ||
// can't answer and making the installer freeze | ||
var valueName = "AutoCheck"; | ||
var data = "True"; | ||
component.addOperation("Execute", reg, "ADD", keyName, "/v", valueName, "/d", data, "/f"); | ||
|
||
var valueName = "CheckURL"; | ||
var data = "http://nrel.github.io/EnergyPlus/epupdate.htm"; | ||
component.addOperation("Execute", reg, "ADD", keyName, "/v", valueName, "/d", data, "/f"); | ||
|
||
var valueName = "LastAnchor"; | ||
var data = "#@Version@"; | ||
component.addOperation("Execute", reg, "ADD", keyName, "/v", valueName, "/d", data, "/f"); | ||
|
||
// Delete the entire keyName upon uninstallation | ||
var keyName = "HKEY_CURRENT_USER\\Software\\VB and VBA Program Settings\\EP-Launch"; | ||
component.addOperation("Execute", "cmd", "/C", "echo Set up uninstall operation to delete EP-Launch registry keys", "UNDOEXECUTE", reg, "DELETE", keyName, "/f"); | ||
|
||
// And weirder still, to copy and register DLLs: done separately | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Associate file types | ||
|
||
function Component() | ||
{ | ||
Component.prototype.createOperations = function() | ||
{ | ||
// call default implementation | ||
component.createOperations(); | ||
|
||
// ... add custom operations | ||
|
||
var kernel = systemInfo.kernelType; | ||
|
||
// On Windows | ||
if( kernel == "winnt" ) { | ||
|
||
// We also need to remove the registry entries that the previous | ||
// installers based on NSIS were doing, since there was no clean up back | ||
// then and they are getting in the way of our new RegisterFileType | ||
// (icons not showing on IDF, IMF etc) | ||
|
||
// Note: The old stuff also installed things in "HKCR\.idf" etc, but I'm wary | ||
// of touching these since they might have been set to something else | ||
// manually like a text editor for eg | ||
var reg = installer.environmentVariable("SystemRoot") + "\\System32\\reg.exe"; | ||
|
||
var keyNamesToDelete = [ | ||
"EP-Launch.epg", "EP-Launch.idf", "EP-Launch.imf", | ||
"IDFEditor.ddy", "IDFEditor.expidf" | ||
]; | ||
|
||
for (i = 0; i < keyNamesToDelete.length; i++) { | ||
var keyName = "HKEY_CLASSES_ROOT\\" + keyNamesToDelete[i]; | ||
// Delete the entry, silently (/f). | ||
// We specify the return codes to ignore the error when the key didn't exist to begin with (which returns 1) | ||
component.addOperation("Execute", "{0,1}", reg, "DELETE", keyName, "/f"); | ||
} | ||
|
||
// Note JM: you normally have to quote the %1 which represents the file path, otherwise any space in the path will think there are multiple args | ||
// That is "@TargetDir@/EP-Launch.exe \"%1\"" | ||
// Except that EP-Launch.exe doesn't behave like most programs. | ||
// It does its internal escaping/considers whatever is passed as a single argument. | ||
// eg: `C:\EnergyPlusV9-2-0\EP-Launch.exe 5ZoneFPIU - Copy.idf` | ||
// successfully loads a file named `5ZoneFPIU - Copy.idf`` | ||
// RegisterFileType: [extension, command, description of filetype, contentType, icon] | ||
// Note: Here you do **not** need to specify the specific iconID, since the EP-launch icon id is actually zero, which is default | ||
// eg: var iconId = 0; icon = "@TargetDir@\\EP-Launch.exe," + iconId | ||
// EP-Launch.exe | ||
component.addElevatedOperation("RegisterFileType", "idf", "@TargetDir@\\EP-Launch.exe %1", "EnergyPlus Input Data File", "text/plain"); | ||
component.addElevatedOperation("RegisterFileType", "imf", "@TargetDir@\\EP-Launch.exe %1", "EnergyPlus Input Macro File", "text/plain"); | ||
component.addElevatedOperation("RegisterFileType", "epg", "@TargetDir@\\EP-Launch.exe %1", "EnergyPlus Group File", "text/plain"); | ||
// IDFEditor.exe | ||
component.addElevatedOperation("RegisterFileType", "ddy", "@TargetDir@\\PreProcess\\IDFEditor\\IDFEditor.exe %1", "EnergyPlus Location and Design Day Data", "text/plain"); | ||
component.addElevatedOperation("RegisterFileType", "expidf", "@TargetDir@\\PreProcess\\IDFEditor\\IDFEditor.exe %1", "EnergyPlus Expand Objects Input Data File", "text/plain"); | ||
|
||
} // End of if winnt | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// Windows commands to be performed elevated: copy and register DLLs | ||
|
||
function Component() | ||
{ | ||
Component.prototype.createOperations = function() | ||
{ | ||
// call default implementation | ||
component.createOperations(); | ||
|
||
// ... add custom operations | ||
|
||
var kernel = systemInfo.kernelType; | ||
// On Windows | ||
if( kernel == "winnt" ) { | ||
|
||
// OCX: needs copy AND registration | ||
// DLL and exe: just copy | ||
// Note: the order of ocx/dll in the array matters for registering the ocx! | ||
// To be safe and not depend on order, let's be smarter: we copy | ||
// everything in one pass, then we register the ones that need to be in a | ||
// second pass | ||
var systemArray = [ | ||
"MSCOMCTL.OCX", "ComDlg32.OCX", "Msvcrtd.dll", "Dforrt.dll", | ||
"Gswdll32.dll", "Gsw32.exe", "Graph32.ocx", | ||
"MSINET.OCX", "Vsflex7L.ocx", "Msflxgrd.ocx" | ||
]; | ||
|
||
var systemTargetDir = installer.environmentVariable("SystemRoot"); | ||
// Note: all dlls in ./bin/System are 32-bits | ||
if( systemInfo.currentCpuArchitecture == "x86_64") { | ||
// This is where the 32-bit stuff is stored on 64-bit systems | ||
// (despite the name...) | ||
systemTargetDir += "\\SysWOW64\\"; | ||
} else { | ||
// This is 32-bit on a 32-bit system | ||
systemTargetDir += "\\System32\\"; | ||
} | ||
|
||
var regdll = systemTargetDir + "regsvr32.exe"; | ||
|
||
// Store ocx to be registered | ||
var dllsToReg = []; | ||
for (i = 0; i < systemArray.length; i++) { | ||
var sourceFile = "@TargetDir@\\temp\\" + systemArray[i]; | ||
var targetFile = systemTargetDir + systemArray[i]; | ||
if (!installer.fileExists(targetFile)) { | ||
console.log("Copying DLL: " + targetFile); | ||
// Copy the DLL (includes reverting on uninstall) | ||
// component.addElevatedOperation("Copy", sourceFile, targetFile); | ||
|
||
// Copy without deleting on uninstall (technically the "/Y" | ||
// (=overwrite with no prompt) isn't needed since we tested target | ||
// didn't exist already | ||
component.addElevatedOperation("Execute", "cmd", "/C", "copy", sourceFile, targetFile, "/Y"); | ||
// Register it: Only for "OCX" | ||
// If it's a .ocx (case insensitive), we save it to be registered | ||
if (systemArray[i].toLowerCase().indexOf(".ocx") !== -1) { | ||
dllsToReg.push(targetFile); | ||
} | ||
} | ||
} | ||
|
||
for (i = 0; i < dllsToReg.length; i++) { | ||
targetFile = dllsToReg[i]; | ||
// Mind the "/s" flag which avoids displaying a [Yes/No] prompt | ||
// that you can't answer and making the installer freeze | ||
console.log("Registering DLL: " + [regdll, "/s", targetFile].join(" ")); | ||
component.addElevatedOperation("Execute", regdll, "/s", targetFile); | ||
// We do not undo | ||
// "UNDOEXECUTE", regdll, "/u", "/s", targetFile); | ||
|
||
} | ||
// Delete this temp directory: use execute to avoid uninstall create | ||
// the opposite (= Mkdir), plus it doesn't delete an empty directory anyways and we use copy (not move) above... | ||
// component.addElevatedOperation("Rmdir", "@TargetDir@/temp"); | ||
// /S = recursive, /Q = quiet | ||
component.addElevatedOperation("Execute", "cmd" , "/C", "rmdir", "/S", "/Q", "@TargetDir@\\temp"); | ||
|
||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (Myoldmopar) - x86_64-MacOS-10.13-clang: OK (1808 of 1808 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (9 of 9 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: OK (1828 of 1828 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: OK (1140 of 1140 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7353-previous-errors-cause-termination-but-no-previous-errors (Myoldmopar) - x86_64-MacOS-10.13-clang: OK (2474 of 2474 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7353-previous-errors-cause-termination-but-no-previous-errors (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: OK (2514 of 2514 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7353-previous-errors-cause-termination-but-no-previous-errors (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7353-previous-errors-cause-termination-but-no-previous-errors (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (9 of 9 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: OK (671 of 671 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7353-previous-errors-cause-termination-but-no-previous-errors (Myoldmopar) - Win64-Windows-10-VisualStudio-16: OK (2474 of 2474 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7353-previous-errors-cause-termination-but-no-previous-errors (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: OK (1140 of 1140 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (Myoldmopar) - Win64-Windows-10-VisualStudio-16: OK (1808 of 1808 tests passed, 0 test warnings)
6150bb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7353-previous-errors-cause-termination-but-no-previous-errors (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: OK (671 of 671 tests passed, 0 test warnings)