银河麒麟用QIFW制作安装包

1、环境

        1.1 系统(x86-64架构)

        

         1.2 软件环境:

                自己编译的qt5.15.2,QIFW4.5,linuxdeployqtx86-64;

2、过程

        2.1 linudeployqt

                把这个程序赋予可执行权限,再放到自己的bin目录

                

cp ./linuxdeployqt-6-x86_64.AppImage /usr/local/bin/linuxdeployqt

                测试是否可用

linuxdeployqt --version

        2.2 把生成的release程序放到一个空文件夹下面,执行:linuxdeployqt Release -appimage

        如果最后只是桌面文件报错,那就是可用了,我们也用不到,后面自己写一个,完成后输出

 

双击OfflineSerial可以测试是否可以运行,可以运行那就没多大问题。 

问题1:没有字体,把你用到的字体放到这个目录/lib/fonts/  ,我只用到了宋体,所以只放了一个宋体,如图

 问题2:文本编辑框只能输入英文,无法切换输入法

把这个文件放入刚生成的plugins的这个目录下,并且赋予执行权限

        2.3 QIFW下载x86-64的直接运行就可以

                后面这个工具使用和windows没有区别,就是需要自己生成个桌面快捷方式。我还有个本地服务,所以自己写了service,下面是我的QS文件,隐藏了两个界面和一个界面中的控件,只做参考,目前还是有点瑕疵。

/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the FOO module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

function Component()
{
    // default constructor
	// hide some pages
	installer.setDefaultPageVisible(QInstaller.LicenseCheck, false);
	if (installer.isInstaller()) {
		if (systemInfo.productType === "windows")
		{
			installer.setDefaultPageVisible(QInstaller.StartMenuSelection, false);
		}
	}
	
	// hide ComponentSelection page SearchLineEdit
	var ComponentSelectionPage = gui.pageWidgetByObjectName("ComponentSelectionPage");
	if(ComponentSelectionPage != null)
	{
		var lineedit1 = gui.findChild(ComponentSelectionPage, "SearchLineEdit");
		if(lineedit1 != null)
			lineedit1.setVisible(false);
	}
}

function operationForLinux()
{
    var params = "Name=OfflineSerial" + "\n";
    params += "Icon=@TargetDir@/logo.ico" + "\n";
    params += "Version=@Version@" + "\n";
    params += "Exec=@TargetDir@/OfflineSerial" + "\n";
    params += "Terminal=false" + "\n";
    params += "Encoding=UTF-8" + "\n";
    params += "Type=Application" + "\n";
    params += "Categories=System" + "\n";
 
    var desktop = "OfflineSerial.desktop";
    component.addElevatedOperation("CreateDesktopEntry", "@TargetDir@/OfflineSerial.desktop", params);
 
    var homeDir = installer.environmentVariable("HOME");
    if(homeDir.length > 0)
    {
            component.addOperation("Copy", "@TargetDir@/OfflineSerial.desktop", homeDir + "/桌面/OfflineSerial.desktop");
    }
}


Component.prototype.createOperations = function()
{
    // call default implementation to actually install README.txt!
    component.createOperations();

    if (systemInfo.productType === "windows") {
		//component.addOperation("CreateShortcut", "@TargetDir@/OfflineSerial.exe", "@StartMenuDir@/OfflineSerial.lnk",
        //    "workingDirectory=@TargetDir@", "iconPath=%SystemRoot%/system32/SHELL32.dll","iconId=1",
        //    "description=OfflineSerial");
		component.addOperation("CreateShortcut", "@TargetDir@/OfflineSerial.exe", "@DesktopDir@/OfflineSerial.lnk",
            "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/logo.ico",
            "description=OfflineSerial");
		
		// regest windows service
		component.addElevatedOperation("Execute", "sc.exe","create","SerialPortServer","start=","auto","binPath=",
		"\"@TargetDir@/OfflineSerialServer.exe\" \"@TargetDir@/serialportservice.conf\"",
		"UNDOEXECUTE","sc.exe","delete","SerialPortServer");
		component.addElevatedOperation("Execute", "sc.exe","start","SerialPortServer",
		"UNDOEXECUTE","sc.exe","stop","SerialPortServer");
    }
	else
	{
		// make desktop
		operationForLinux();
		// install service
	    var params = "[Unit]\n";
		params      += "Description=****** service\n";
		params      += "[Service]\n";
		params      += "Type=forking\n";
		params      += "ExecStart=@TargetDir@/OfflineSerialServer @TargetDir@\n";
		params      += "[Install]\n";
		params      += "WantedBy=OfflineSerialServer.target";

		component.addOperation("PrependFile","@TargetDir@/OfflineSerialServer.service",params);
		component.addOperation("Replace","@TargetDir@/serialportservice.conf","BACKPATH","@TargetDir@/back","string");
		component.addElevatedOperation("Execute","@TargetDir@/OfflineSerialServer","-i", "UNDOEXECUTE","@TargetDir@/OfflineSerialServer","-u");
		component.addElevatedOperation("Copy","@TargetDir@/OfflineSerialServer.service","/lib/systemd/system/OfflineSerialServer.service");
		component.addElevatedOperation("Execute","systemctl","daemon-reload","UNDOEXECUTE", "systemctl","daemon-reload");
		component.addElevatedOperation("Execute","systemctl","enable","OfflineSerialServer.service");
		component.addElevatedOperation("Execute","systemctl","start","OfflineSerialServer.service" ,"UNDOEXECUTE","systemctl","stop","OfflineSerialServer.service" );
	}
}

[个人备忘] 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
银河麒麟VNC服务端离线安装包是一种提供远程桌面访问功能的软件包。它可以在银河麒麟操作系统上运行,并允许用户通过网络连接到另一台计算机的桌面,以实现远程操控和文件传输等操作。 离线安装包是指可以在没有网络连接的情况下进行安装的软件包。相比在线安装,离线安装包将所有安装所需的文件都打包在一个可以独立执行的安装程序中,用户可以将这个安装包下载到本地,然后在离线环境中进行安装,省去了下载过程中可能遇到的网络问题。 银河麒麟VNC服务端离线安装包的使用非常简单。首先,用户需要从官方网站或其他可靠的来源下载这个离线安装包的压缩文件。然后,在需要安装的计算机上解压缩这个文件,并运行其中的安装程序。 在安装过程中,用户可以按照提示完成各项设置,如选择安装位置、选择安装组件等。安装完成后,用户可以启动VNC服务端程序,并进行相关的配置,如设置连接端口、设置密码等。配置完成后,用户可以通过VNC客户端软件连接到这台计算机的桌面,实现远程操控。 总的来说,银河麒麟VNC服务端离线安装包是一种方便用户进行远程桌面操作的工具。用户只需要下载安装包,按照提示完成安装和配置,即可实现远程操作。这对于需要经常进行远程操作或需要远程支持的用户来说,是一个非常实用的工具。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值