visual-studio-2008windows-mobileinstallationcabcabwiz

Exclude setup.dll from Smart Cab Project in VS2008


I have added some custom actions to our installer which is run on CE5 and WM6. This installer works fine and builds fine. There is however one annoyance. The setup.dll is deployed to the device and this file is not necessary.

I've read several websites on creating a setup.dll file, MSDN and even the mobile SDK. They all state the same set of steps.

  1. Create your C++ dll project.
  2. Ensure the output is called setup.dll.
  3. On your cab project click on CE Setup DLL, browse, application folder, add output and select your setup project. (You cannot select a local directory, its always a directory on the target machine)

Now this does work and produce a custom cab installer. However as mentioned the setup.dll is copied across into the application folder, even though it is not required after installation (not even for the uninstall)

I tried to exclude the setup.dll by setting exclude to true in its properties. All this does is not include the file a all so the cab files to build as the setup.dll is missing.

As such the only solution i have arrived at is manually changing the cab .inf the file from

[DefaultInstall]
CEShortcuts=Shortcuts
AddReg=RegKeys
CopyFiles=Files.Common1,Files.Common2,Files.Common3,Files.Common4
CESetupDLL="Setup.dll"

to

[DefaultInstall]
CEShortcuts=Shortcuts
AddReg=RegKeys
CopyFiles=Files.Common1,Files.Common2,Files.Common3
CESetupDLL="Setup.dll"

Where Files.Common4 pointed to the setup.dll file locally on the machine. Doing this change means it is used to build the cab file, but the file is not copied across.

Is there anyway of doing this change in visual studio, or is it always going to be a manual edit of the .inf file and the a manual build of the cab file with cabwiz.exe?


Solution

  • I'm a bit confused. You've created a setup.dll installer extension, and included it in the CAB, but you don't want it on the device? In order for your custom actions to execute during the CAB extraction, the DLL has to be in the CAB and extracted on the device.

    If you don't want it on the device, simply omit it from the CopyFiles and delete the CESetupDLL entry from the INF. Obviously doing this then means whatever custom actions it defines cannot run.

    To be clear, this DLL that you're referencing is for custom on-device actions during install and/or uninstall. It will not provide any desktop functionality.