I had to revisit an old project today. A new requirement meant code modification and rebuilding the install for a smart device (iPaq).
CabWiz.exe generated some errors which made no sense during the rebuild process:
Windows CE CAB Wizard
Warning: Section [RegKeys] has no data
Warning: Section [DefaultInstall] key "AddReg" - there are no section entries to process
Error: CAB file "C:\MyPrjDir\PocketCalcCab\Release\PocketCalcCab.CAB" could not be created
ERROR: The Windows CE CAB Wizard encountered an error.
See the output window for more information.
This error looks awful, but the fix is simple.
Here's the command line that was used by VS 2008:
"d:\vs2009\smartdevices\sdk\sdktools\cabwiz.exe"
"C:\MyProjDir\PocketCalcCab\Release\PocketCalcCab.inf"
/dest "C:\MyProjDir\PocketCalcCab\Release\" /err CabWiz.log
It turns out that an old version of the cab file existed in the directory "C:\MyProjDir\PocketCalcCab\Release\". The file was marked as read only. Removing the read only attribute corrected the situation.
Here's the cabwiz.ex output after correcting the problem:
Starting pre-build validation for project 'PocketCalcCab' ------
------ Pre-build validation for project 'PocketCalcCab' completed ------
------ Build started: Project: PocketCalcCab, Configuration: Release ------
Building file 'C:\MyProjDir\PocketCalcCab\Release\PocketCalcCab.cab'...
The steps to fix the problem are simple:
- Check to see if a CAB file already exists in the output directory of the cabinet maker project.
- If a CAB file exists, check to see if it is read only.
- If it is read only, delete it or remove the read only attribute
- If that fails, make sure you have full permissions to the output directory where VS 2008 wants to place the CAB file.
Microsoft should really clean up the cabwiz.exe error messages.