Installing multiple CAB files with the same setup application

本文介绍如何使用NSIS创建一个安装程序,该程序能够为Pocket PC安装多个CAB文件。通过一个示例项目说明了如何显示许可协议,允许用户选择安装内容,并最终使用CeAppMgr安装CAB文件。

Installing multiple CAB files with the same setup application

By Alexandru Balut, February 28, 2003.
Print version

Introduction

This articles describes how to create desktop installation program that installs multiple CAB files to Pocket PC using freeware NSIS.

Once you have the CAB file generated by cabwiz, and it's ini file, it is easy to make a setup application that displays a readme text and a licence, and installs it on the pocketpc; for example using EzSetup 2.0.

What You Need

 

 

Using NSIS

If you need to install, with only one setup application, two or more CAB files (for example a CAB file containing your Java application and a CAB containing the JVM), or if you need a setup application with extended functionality, you can use Nullsoft Install System - NSIS http://www.nullsoft.com/free/nsis. Both EzSetup and NSIS are freeware.

To use NSIS for making a setup application, you need a .nsi file. The nsi file included in the provided sample allows you to make a setup that installs two CAB files. It first displays a eula.txt; after the user agrees with it, it allows the user to deselect the installation of the second app. Then it copies the files and installs the CABs using CeAppMgr. At the end, it asks the user to open readme.html, using the default browser.

To install a CAB file on the pocketpc, for example YourApp.cab, the setup application has to start CeAppMgr.exe, passing as parameter the absolute path to the YourApp.ini file that is required by CeAppMgr.

To accomplish this, the setup application has to read the location of CeAppMgr.exe, from the registry:

ReadRegStr $1 HKEY_LOCAL_MACHINE "software/Microsoft/Windows/CurrentVersion/App Paths/CEAppMgr.exe" ""

 

Installing the CAB becomes as simple as:

StrCpy $0 "$INSTDIR/YourApp.ini" Call InstallCAB

 

where InstallCAB is:

Function InstallCAB ExecWait '"$1" "$0"' FunctionEnd

 

Sample

You can download a sample NSIS project for multiple CAB installation here - MultiCabInstallation.zip (200 Kb). To build the sample setup application, install NSIS, right-click on test.nsi, click Compile NSI.

Related resources:

Discuss

Discuss this article. Here you can write your comments and read comments of other developers.

<think>我们注意到用户的问题是关于安装MCP服务器(可能是Minecraft Coder Pack或类似工具)的安全警告。用户意图是想了解这个警告的含义以及如何安全地安装MCP服务器。 由于问题中已经包含了一段警告信息,因此我们需要解释这段警告,并提供安全安装的建议。 步骤: 1. 解析警告信息:安装MCP服务器将以当前用户的权限执行命令,这意味着如果服务器来源不可信,可能会对系统造成损害。 2. 提供安全建议:如何确保来源可信?如何降低风险? 根据要求,我们需要进行网络搜索,但由于当前环境无法实际执行网络搜索,我们将基于已有知识生成回答,并模拟整合搜索结果。 模拟搜索整合: - 根据Minecraft Coder Pack的官方文档或常见安全实践,安装任何需要执行命令的软件时,都应确保来源可靠。 - 建议用户从官方渠道下载MCP服务器,并验证文件完整性(如使用校验和)。 - 建议在隔离环境中(如虚拟机或容器)运行,以减少对主系统的风险。 - 使用最低权限原则,即不要使用root或管理员账户运行,而是使用普通用户账户。 回答结构: 我们将按照要求,不使用第一人称,避免步骤词汇,分成多个方法或步骤(每个步骤换行),并且最后添加相关问题。 注意:由于无法实际搜索,以下回答基于常识和安全最佳实践。 </think>### 安装MCP服务器的安全警告解析与防护措施 安装MCP(Minecraft Coder Pack)服务器时,系统提示"将以当前用户权限执行命令",此警告表明操作存在高风险: - **权限风险**:安装脚本或服务拥有与当前用户相同的系统权限(如读写文件、修改配置、执行程序),恶意代码可能导致数据泄露或系统破坏。 - **信任依赖**:仅当完全验证服务器来源可靠性(官方仓库/可信开发者)时方可继续,未经验证的来源可能包含后门程序。 **安全安装步骤**: **验证来源可信度** 访问MCP官方渠道(如[MinecraftForge](https://files.minecraftforge.net/)或GitHub认证仓库),比对文件哈希值(SHA-256/MD5)。示例校验命令: ```bash echo "官方提供的SHA256值 文件名" | sha256sum -c ``` **创建隔离环境** 使用专用低权限用户账户运行服务器,限制潜在损害范围: ```bash sudo useradd -m mcuser # 创建新用户 sudo passwd mcuser # 设置密码 sudo -u mcuser ./install_mcp.sh # 指定用户运行安装脚本 ``` **配置沙盒防护** 通过容器技术隔离运行环境(如Docker): ```dockerfile FROM openjdk:17 WORKDIR /app COPY mcp_server_files ./ CMD ["./start_server.sh"] ``` 执行构建与运行: ```bash docker build -t mcp-container . docker run -d --name mcp-instance mcp-container ``` **审计执行命令** 解压安装包后审查脚本内容,重点关注以下高危操作: - `chmod 777`(过度开放权限) - `wget`/`curl`(远程下载未验证文件) - `rm -rf`(递归删除文件) **实施最小权限原则** 安装后通过访问控制列表(ACL)限制目录权限: ```bash setfacl -m u:mcuser:r-x /critical_system_path # 禁止写入关键路径 ``` ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值