Я хочу автоматически загрузить двоичный файл после завершения установки с использованием среды установки Qt. Как этого можно достичь?
Я пытаюсь отредактировать этот скрипт и добавить component.addOperation("CreateShortcut", "@TargetDir@/DistributionKit/Abc.sh"); Но он не загружает скрипт автоматически. Что мне не хватает?
function Component()
{
installer.installationFinished.connect(this, Component.prototype.installationFinishedPageIsShown);
installer.finishButtonClicked.connect(this, Component.prototype.installationFinished);
}
Component.prototype.createOperations = function()
{
component.createOperations();
}
Component.prototype.installationFinishedPageIsShown = function()
{
try {
if (installer.isInstaller() && installer.status == QInstaller.Success) {
installer.addWizardPageItem( component, "ReadMeCheckBoxForm", QInstaller.InstallationFinished );
}
} catch(e) {
console.log(e);
}
}
Component.prototype.installationFinished = function()
{
try {
if (installer.isInstaller() && installer.status == QInstaller.Success) {
var isReadMeCheckBoxChecked = component.userInterface( "ReadMeCheckBoxForm" ).readMeCheckBox.checked;
if (isReadMeCheckBoxChecked) {
//QDesktopServices.openUrl("file:///" + installer.value("TargetDir") + "/Abc.sh");
component.addOperation("CreateShortcut", "@TargetDir@/DistributionKit/Abc.sh");
}
}
} catch(e) {
console.log(e);
}
}
QDesktopServices.openUrl("file:///....");
с .... абсолютным путем к вашему файлу. Точно так же, как вы это прокомментировали в своем примере. - person apalomer   schedule 02.06.2020installer.executeDetached
- person apalomer   schedule 02.06.2020