Creating CAB File for Windows Moblie

本文介绍如何使用CABWizard创建Windows CE平台上的应用程序安装包(.cab文件),包括必要的批处理脚本设置、INF文件编写步骤及签名过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://agent021.wordpress.com/category/windows-cemobile-platform/build-system/

 

Once your driver or application is ready (or for debugging), you can use the CAB Wizard to create cabinet (.cab) files to test the installation of your driver or application on the device. This cab file acts like a container, holding all necessary device driver or application files. ensures that these files are present at installation.

How ??
1. Make the *.cab file and *.inf by using the any text editor (UTF-8 encoded). You can use the Cabwiz.exe which is available on your SDK Tools. The Syntax is available on

BATCH FILE
——————MyCabFile.bat————–START———————————————————————————————–
set _WINCEROOT=C:/WMXXX        :: AKU Path
set WORK_ROOT=C:/ARUN/CabMaker  :: Where your *.inf file is plcaced & cab file is made
set TEMP_PROJ_DEBUG=”E:/WMXXXX/release/BSP/WPC”    :: Where you keep the files to make it as Cab File
set TEMP_TRGT_DEBUG=”E:/WMXXXX/PUBLIC/SHELLW/OAK/TARGET/CPUVERSION/DEBUG”    :: A Temp Debug Dir

:: Change Dir to C
C:
:: Copying Dll,exe,*.AnyExtn Files  From Project Folder To Target Folder
copy %TEMP_PROJ_DEBUG%/File1.dll %TEMP_TRGT_DEBUG%/File1.dll
copy %TEMP_PROJ_DEBUG%/File2.exe %TEMP_TRGT_DEBUG%/File2.exe

:: Where you have CabWiz tool installed along with SDK
cd “C:/SDK_Tools_PATH/CabWiz”

::cabwiz %WORK_ROOT%/MyCabFile.inf ALL the Details about Cab is wrtten in this inf file
cabwiz %WORK_ROOT%/MyCabFile.inf

E:
:: Chage path to singing tool
cd “Singing tool path”

::signing the cab
signing_command %WORK_ROOT%/MyCABFile.cab

C:
:: back to the home Dir
cd C:/ARUN/CabMaker/

——————MyCabFile.bat————–END————————————————————————————————

INFORMATION FILE
INF File (Information File) uses the Microsoft Win32® Setup format with Windows CE–specific modifications.
The most common operations for installing an application like copying files and setting registry keys are done thru this. Details like where the files should be placed and which registry keys should be created or modified can be inputed in .inf file. .inf file is text based.

——————MyCabFile.inf————–START———————————————————————————————–

;The following are some imp required Sections in an .inf file (in [])

[Version]
Signature = “$Windows NT$”    ;Signature name (of the OS), which must have a value of either “$Windows NT$”, or “$Windows 95$”.
Provider = “LinkinPark_Corp”    ;Company which makes
CESignature = “$Windows CE$”
;Describes the creator and version of the application.
;NOTE: Windows CE file system reserved characters are //:*?” < >|&.

[CEStrings]
AppName     = TestAppFromArun
;Contains string substi for application and directory names.

[CEDevice]
VersionMin = minor_version
VersionMax = major_version
BuildMax = 0xE0000000    ;Supports both square screens and screen rotation.

[DefaultInstall]    ;Describes the default method used to install the application.
CopyFiles = Files.Common
AddReg = Registry.Common

[Strings]
_WONCEROOT = “E:/WMXXXX”
WONCEDEBUG = “DEBUG_???_FDLR”
;String definitions for one or more strings.
;Edit these first two strings to match the environment settings of the same name

[Files.Common]
File1.dll,,,0    ; destination_filename,[source_filename],[,flags]
File2.exe,,,0

[SourceDisksNames]
1 = ,,,%_WONCEROOT%/PUBLIC/SHELLW/OAK/TARGET/CPUVERSION/%WONCEDEBUG%
2 = ,,,.
;Contains the name and path of the directories on the hard disk where the application files reside.

[SourceDisksFiles]
File1.dll = 1
File2.exe = 1
; Contains the source filenames of the files which comprise the application.

[DestinationDirs]
Files.Common = 0,%CE2%
; Contains the names and paths of the destination directories for the application on the target device.
;Installation Macro Strings for Mobile Applications

Macro stringPocket PC directory
%CE1%/Program Files
%CE2%/Windows
%CE4%/Windows/StartUp
%CE5%/My Documents
%CE8%/Program Files/Games
%CE11%/Windows/Start Menu/Programs
%CE14%/Windows/Start Menu/Programs/Games
%CE15%/Windows/Fonts
%CE17%/Windows/Start Menu

[Registry.Common]
HKLM, _PATH_, KEY_Name, 0×00010001, 1

——————MyCabFile.inf————–END————————————————————————————————

How to make Cab file
1. First make a MakeCabFile.bat file. (which manages the process)
2. Then make apprpriate MakeCabFile.inf file (which has MS Specific syntax and modifications)
3. Go to Command promt and set needed evironment variables if needed.
4. execute the bat file
Here the important thing is that proper signing should be done for each items which you are puting in the cabinet.
5. Cab file will be created.
6. Copy the cab file to the device and execute.
Device may ask to reboot if any contents of the cab is already there in the device.

Ref:

Cab Wizard

Information File

Command-Line Tool Commands

Courtesy: Microsoft

<think>我们正在解决创建邮箱文件时出现的“Fileexists”错误。根据用户的问题,我们需要提供修复方法。根据引用[1]:邮箱是一种消息传递结构,允许不同进程之间进行消息交换。在SystemVerilog中,邮箱有固定容量,满了会阻止投递。但这里的错误是在创建邮箱文件时出现的,可能是操作系统层面的问题。错误信息“File exists”通常表示尝试创建的文件已经存在。因此,我们需要检查并处理已存在的文件。可能的解决方案:1.删除已存在的邮箱文件:如果该文件不再需要,可以直接删除。2.重命名现有的邮箱文件:如果怀疑文件可能有用,可以先重命名备份。3.检查邮箱系统配置:可能是配置指向了一个已存在的文件,需要调整配置。步骤:1.定位邮箱文件的位置。通常邮箱文件位于用户的邮件目录下,如`/var/mail/username`或`/var/spool/mail/username`(在Linux系统中)。2.检查该文件是否存在:```bashls -l /var/mail/username```3.如果存在,删除或移动它:```bashsudorm /var/mail/username#删除#或者sudo mv/var/mail/username/var/mail/username.bak#备份```4.重新运行创建邮箱文件的命令。注意:操作邮箱文件可能需要管理员权限,所以使用`sudo`。另外,引用[2]提到Oracle创建固定表和视图,引用[3]是博客设置示例,与当前问题无关,因此我们主要参考引用[1]中关于邮箱的概念,但具体解决方法是系统层面的。如果用户是在编程环境中遇到此错误(例如使用SystemVerilog的邮箱),那么错误可能是在仿真时产生的,此时需要检查测试平台中邮箱的创建和销毁过程,确保没有重复创建。然而,用户的问题描述更偏向于系统操作(Creatingmailbox file),所以我们优先考虑系统操作步骤。如果上述方法无效,可能需要检查邮件服务配置,如Postfix或Sendmail,确保邮箱路径设置正确。总结:主要原因是文件已存在,删除或移动该文件即可。生成相关问题:1.如何更改Linux系统中默认的邮箱位置?2.如何配置Postfix以避免邮箱文件冲突?3.在SystemVerilog中如何正确使用邮箱?</think>### 解决"Creating mailbox file error: File exists"错误 此错误通常发生在创建邮箱文件时系统检测到同名文件已存在。以下是系统级的解决方案: #### 1. **检查并删除冲突文件** ```bash # 查看邮箱文件位置(通常为 /var/mail/username 或 /var/spool/mail/username) ls -l /var/mail/$USER # 删除已存在的冲突文件(需sudo权限) sudo rm /var/mail/username ``` **注意**:删除前建议备份 `sudo cp /var/mail/username ~/mail_backup` #### 2. **重建邮箱文件** ```bash # 强制重建邮箱文件(Postfix示例) sudo postfix -c /etc/postfix flush sudo postfix reload ``` #### 3. **检查文件系统权限** ```bash # 确保邮箱目录权限正确(Maildir格式示例) sudo chown -R username:mail /home/username/Maildir sudo chmod -R 700 /home/username/Maildir ``` 权限要求: - 邮箱目录:`700` - 所属用户:邮件系统用户(如 `dovecot` 或 `postfix`) #### 4. **检查邮件服务配置** ```ini # /etc/dovecot/conf.d/10-mail.conf mail_location = maildir:~/Maildir # 确保路径唯一 ``` 配置后重启服务: ```bash sudo systemctl restart dovecot ``` #### 5. **修复用户ID冲突** 当用户ID与系统用户冲突时: ```bash # 检查用户ID id username # 修改冲突用户的UID(例如改为5000) sudo usermod -u 5000 conflicting_user ``` ### 根本原因分析 1. **残留文件**:用户删除后未清理邮箱文件[^1] 2. **权限错误**:文件属主与邮件系统不匹配 3. **配置冲突**:多邮件服务使用相同存储路径 4. **UID重复**:系统存在相同用户ID的账户
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值