cbono
Posts: 42
Joined: Thu Aug 14, 2008 10:11 pm

Mobile CAB: Same Filename (but diff. file) per Configuration

I'm using AI 7.1.3 and building a Windows Mobile CAB project with multiple configurations -- one for Windows Mobile 5 (WM5) and one for Windows Mobile 6 (WM6).

I have 2 versions of a DLL: 1 works on WM5 devices, the other works on WM6 devices. While the filenames are identical (SDiD_Driver.dll), they have different file versions and come from different "source" directories:
C:\src\drivers\WM5\SDiD_Driver.dll
C:\src\drivers\WM6\SDiD_Driver.dll


As you might have guessed, I want to specify the appropriate one for my WM5 and WM6 configurations. But AI won't let me specify 2 files with duplicate filenames to install into the same directory.

I got around this problem in our old INF CAB script by redefining the SourceDisksNames entry:

Code: Select all

[SourceDisksNames]
1=,"Common1",,"Dir1"
2=,"Common2",,"Dir2"
3=,"Common3",,"Dir3"
4=,"Common4",,"Dir4"
5=,"Common5",,"Src\Drivers\WM5\"

[SourceDisksNames.WM6]
5=,"Common5",,"Src\Drivers\WM6\"

[SourceDisksFiles]
...
"SDiD_Driver.dll"=5
So you see, I have only 1 definition under SourceDisksFiles for the DLL -- but when I invoke this INF to build a CAB with the WM6 switch, it copies the driver from the WM6 directory instead of the WM5 directory.

Is there some workaround I could use to duplicate this behavior? Really this is the only bit that is keeping me from switching our CAB installer completely over to AI (and I really want to do that).

Thanks!
-Chris
Bogdan
Posts: 2791
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Mobile CAB: Same Filename (but diff. file) per Configuration

Hi,
I want to specify the appropriate one for my WM5 and WM6 configurations. But AI won't let me specify 2 files with duplicate filenames to install into the same directory
To specify two files with the same name into the same folder follow these steps:
-- create two different folders in that location, with random names
-- put each file in a folder
-- double click the folder
-- check the "Install folder content into parent folder" checkbox from the Component group

This should solve your problem.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
cbono
Posts: 42
Joined: Thu Aug 14, 2008 10:11 pm

Re: Mobile CAB: Same Filename (but diff. file) per Configuration

Hi Bogdan,

Thanks for the suggestion, but I think that approach will only work in a "normal" installation project. When dealing with a Windows Mobile CAB project, I don't have the "Components" page, nor can I perform any action on a folder by double-clicking it.

However, I can add an additional "Windows" folder (this is the target folder), and AI seems to accept it. The caveat here is that it's not taking advantage of the WinCE strings (the system folder is represented by %CE2%), so if the system folder didn't happen to be named exactly "Windows" for some reason, the installation might fail.

-Chris
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Mobile CAB: Same Filename (but diff. file) per Configuration

Hello,

You need to create Configurations for each of the platforms you want to target in the Configuration page. For each Configuration you can specify which device types are targeted by your application in the Target Platforms tab.

Then, from the Files and Folders page, use the Configurations tab in the Edit File dialog to specify the source path of your file for each configuration. To reach this page, right click your file, select Properties and go to Configurations tab.
However, I can add an additional "Windows" folder (this is the target folder), and AI seems to accept it.
Allowing the creation of hard-coded paths (such as "\Windows") is intentional, in order to prevent a bug that appears on older WinCE devices when %CEn% directory macros are used. For these devices (prior to WinCE 3.0), directories are not created if they are not directly beneath the Installation Folder (InstallDir). Using a hard-coded path solves this problem but may not install to the desired directory on localized Windows CE devices.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
cbono
Posts: 42
Joined: Thu Aug 14, 2008 10:11 pm

Re: Mobile CAB: Same Filename (but diff. file) per Configuration

Gabriel,

I totally did not realize you could specify a path on the Configuration tab like that. It wasn't obvious that it was editable (I guess I should have read the help file more carefully). This is exactly what I needed to finish this installer up.

Thanks much!

-Chris

Return to “Common Problems”