| 1 |
function Component() { |
| 2 |
var targetDir = installer.value("TargetDir", "@ApplicationsDir@/Alire") |
| 3 |
|
| 4 |
installer.setValue("TargetDir", targetDir); |
| 5 |
installer.setDefaultPageVisible(QInstaller.Introduction, false); |
| 6 |
installer.setDefaultPageVisible(QInstaller.TargetDirectory, true); |
| 7 |
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false); |
| 8 |
installer.setDefaultPageVisible(QInstaller.ReadyForInstallation, false); |
| 9 |
installer.setDefaultPageVisible(QInstaller.StartMenuSelection, true); |
| 10 |
installer.setDefaultPageVisible(QInstaller.LicenseCheck, false); |
| 11 |
} |
| 12 |
|
| 13 |
Component.prototype.isDefault = function() |
| 14 |
{ |
| 15 |
// select the component by default |
| 16 |
return true; |
| 17 |
} |
| 18 |
|
| 19 |
function createShortcuts() |
| 20 |
{ |
| 21 |
var shortcuts = ["@StartMenuDir@/Alire.lnk", "@DesktopDir@/Alire.lnk"]; |
| 22 |
for (shortcut of shortcuts) { |
| 23 |
component.addOperation("CreateShortcut", "powershell", shortcut, |
| 24 |
"-NoExit -Command \"$env:Path += \"\"\";@TargetDir@\\bin\"\"\"; \"$host.UI.RawUI.BackgroundColor = \"\"\"DarkBlue\"\"\"; clear-host\"", |
| 25 |
"workingDirectory=@HomeDir@", |
| 26 |
"iconPath=@TargetDir@/share/alire/alr_icon.ico", |
| 27 |
"description=Start App"); |
| 28 |
|
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
Component.prototype.createOperations = function() |
| 33 |
{ |
| 34 |
component.createOperations(); |
| 35 |
createShortcuts(); |
| 36 |
} |