diff options
| author | 2018-07-27 23:54:15 -0400 | |
|---|---|---|
| committer | 2018-07-27 23:54:15 -0400 | |
| commit | 6d3d39356473078c6b47e03b8a7616e4b34de928 (patch) | |
| tree | fe5be2e6a08e4cfc73207746aba4c9fccfecfa10 /SQLiteStudio3/sqlitestudio/installscript.qs | |
| parent | f98e49169a40876bcf1df832de6e908d1b350193 (diff) | |
| parent | feda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff) | |
Update upstream source from tag 'upstream/3.2.1+dfsg1'
Update to upstream version '3.2.1+dfsg1'
with Debian dir 5ea0333565de4dc898c062cc0ff4ba1153e2c1e4
Diffstat (limited to 'SQLiteStudio3/sqlitestudio/installscript.qs')
| -rw-r--r-- | SQLiteStudio3/sqlitestudio/installscript.qs | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/SQLiteStudio3/sqlitestudio/installscript.qs b/SQLiteStudio3/sqlitestudio/installscript.qs new file mode 100644 index 0000000..8e6b84b --- /dev/null +++ b/SQLiteStudio3/sqlitestudio/installscript.qs @@ -0,0 +1,64 @@ +function Component() +{ + if (installer.value("os") === "win") { + component.loaded.connect(this, addOptionsCheckBoxForm); + component.fileTypes = ['db', 'db3', 'sqlite', 'sqlite3', 'sdb', 's3db']; + } +} + +addOptionsCheckBoxForm = function() +{ + // don't show when updating or uninstalling + if (installer.isInstaller()) { + installer.addWizardPageItem(component, "OptionsCheckBoxForm", QInstaller.TargetDirectory); + var form = component.userInterface("OptionsCheckBoxForm"); + + var assocCheckBox = form.RegisterFileCheckBox; + assocCheckBox.text = assocCheckBox.text + component.fileTypes.join(', '); + + var startMenuCheckbox = form.CreateStartMenuEntry; + startMenuCheckbox.stateChanged.connect(this, function() { + installer.setDefaultPageVisible(QInstaller.StartMenuSelection, startMenuCheckbox.checked); + }); + } +} + +Component.prototype.createOperations = function() +{ + // call default implementation to actually install the app + component.createOperations(); + + if (installer.value("os") === "win") { + var form = component.userInterface("OptionsCheckBoxForm"); + var isRegisterFileChecked = form.RegisterFileCheckBox.checked; + var isStartMenuEntryChecked = form.CreateStartMenuEntry.checked; + var forAllUsersChecked = form.CreateStartMenuEntry.ForAllUsers.checked; + + var executable = "@TargetDir@/SQLiteStudio.exe"; + + var linkPrefix = "@UserStartMenuProgramsPath@"; + if (forAllUsersChecked) { + linkPrefix = "@AllUsersStartMenuProgramsPath@"; + } + + if (isRegisterFileChecked) { + component.addOperation("CreateShortcut", executable, linkPrefix + "/@StartMenuDir@/SQLiteStudio.lnk", + "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/SQLiteStudio.exe", + "iconId=0", "description=SQLiteStudio"); + } + + if (isRegisterFileChecked) { + component.fileTypes.forEach(function(fileType) { + component.addOperation( + "RegisterFileType", + fileType, + executable + " '%1'", + "SQLite database", + "application/octet-stream", + executable + ",0", + "ProgId=SQLiteStudio." + fileType + ); + }); + } + } +} |
