Я попытался создать установщик, следуя инструкциям. Затем я добавил сценарий с именем installerscript.qs в соответствии с примером стартового меню в каталоге Qt Installer Framework.
Файл installscript.qs выглядит следующим образом:
/****************************************************************************
**
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
**
**
** open-editor to use.
** Copyright (C) 2018 os_sys-devlopment-group
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <https://www.gnu.org/licenses/>.
** view the full license at https://www.stranica.nl/open-editor/license.txt
**
** $QT_END_LICENSE$
**
****************************************************************************/
function Component()
{
// default constructor
}
Component.prototype.createOperations = function()
{
component.createOperations();
if (systemInfo.productType === "windows") {
component.addOperation("CreateShortcut", "@TargetDir@/customtexteditor.exe", "@StartMenuDir@/open-editor.lnk",
"workingDirectory=@TargetDir@","iconPath=%TargetDir%/Logo.ico");
component.addOperation("CreateDesktopShortcut", "@TargetDir@/customtexteditor.exe", "@DesktopDir@/open-editor.lnk",
"workingDirectory=@TargetDir@", "iconPath=%TargetDir%/Logo.ico",);
}
}
Мой package.xml выглядит следующим образом:
<?xml version="1.0" encoding="UTF-8"?>
<Package>
<DisplayName>open-editor</DisplayName>
<Description>open-editor</Description>
<Version>1.0.2</Version>
<ReleaseDate>2019-11-10</ReleaseDate>
<Default>true</Default>
<Name>open-editor</Name>
<Licenses>
<License name="End User License Agreement" file="license.txt" />
</Licenses>
<ForcedInstallation>true</ForcedInstallation>
<Script>installscript.qs</Script>
</Package>
Когда я запускаю установщик, я получаю сообщение об ошибке:
Exception while loading component script "D:\system\temp\remoterepo-Q2Q7ZU\open-editor\installscript.qs": TypeError: cannot read property 'name' of null on line number: 1
Этот пример работал, когда я пробовал его в каталоге примеров. Но дает мне указанную выше ошибку, когда я немного изменяю ее для работы с моим собственным кодом.
есть идеи, почему это не работает?
я использую эту команду для двоичного создателя:
..\..\bin\binarycreator.exe --online-only -c config\config.xml -p packages installer.exe
вы можете перейти по следующей ссылке, чтобы просмотреть весь проект: https://ftp.stranica.nl/index/help/project вы можете найти все файлы моего проекта
zip-файл в этом каталоге содержит весь пакет
я внес изменения во все свои пакеты, так что теперь все выглядит немного по-другому, но то же самое
binarycreator
? Из того, что вы написали, я не вижу никакой проблемы. Но мне интересно, откуда он получает путьcom.mycompany.program
. IIRC путь к пакетам задается параметром-p
и дополнительным списком пакетов в этой папке с параметром-l
. Вы используете абсолютные или относительные пути для указания различных местоположений? (Не уверен, что это имеет значение, но может быть.) - person Maxim Paperno   schedule 14.11.2019