Windows Mobile Application ... installation issue RRS feed

  • Question

  • Not sure if this is the correct forum, but I ran into an interesting Windows Mobile Application installation issue and wanted to see if anyone knows the "whys and what's" of the problem.


    I created a .NET Compact Framework v3.5 application that is used to update some of the power policies on a device (essentially to make sure the screen is always backlit and that the WAN radio is never disconnected or powered down) on a handheld barcode scanner.  The device is using WM v5.0 R2 (the version that supports "pushed" e-mails from Exchange 2003/7).  It's a simple application and runs just fine on the device.  My problem is centered around my "MSI" installer project.

    I have created close to 60 different mobile projects using my VS 2005 Pro, and have always used the "Setup Project" type when building a desktop installation program that will load my CAB file using ActiveSync.  My installation programs always use an "InstallerDLL" project which does nothing more then handle the reading of the regsitery to find ActiveSync on the desktop PC, copy the Setup.ini and CAB files (and any additional DLL's) to the proper paths, and invoke the ActiveSync executable in a new process passing the path of the Setup.ini file as a startup parameter.  Simple, done it a "thousand times," so .... what went wrong when doing this from VS 2008 Pro????

    Being a .NET 3.5 mobile application, I thought I would create the Setup Project from my VS 2008 Pro, using my various 2005 installer projects as a guide on what code and resources I would need to make this work.  When I run the MSI installer everything works as you would expect ..... but when it gets to the part where ActiveSync looks at the Setup.ini file there's an error that gets thrown that says something similar to "INVALID WINDOWS CE SETUP FILES - can not intall this application on your mobile device dur to an invalid set up file. Reinstall and try again."

    As a reality check, I turned around and create the same MSI installer using VS 2005 (using the same Setup.ini, CAB files, DLL's, etc., etc., etc.) and it works perfectly fine.  I only expereince this error if using VS 2008 to create the Setup Project.

    Any ideas on why this is the case, or what to do to fix it??  Does VS 2008 expect a different "format" for Setup.ini files??

    Sunday, April 26, 2009 6:53 PM

All replies

  • Hi MarkIsMobile,

    I tried a sample in vs2008, there is no difference about setup between vs2008 and vs2005, both setup project works fine on device via acitvesync. I suggest you create simple installer class and setup.ini, which may help you find the problem, below is my code, which works both on vs2008 and vs2005:

    Installer1 class:
       public partial class Installer1 : Installer
            private const string CEAPPMGR_PATH = @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\CEAPPMGR.EXE";
            public Installer1()
                this.AfterInstall +=
                        new InstallEventHandler(CustomInstaller_AfterInstall);
                this.BeforeUninstall +=
                        new InstallEventHandler(CustomInstaller_BeforeUninstall);
            void CustomInstaller_AfterInstall(object sender, InstallEventArgs e)
                RegistryKey keyAppMgr =Registry.LocalMachine.OpenSubKey(CEAPPMGR_PATH);
                string appMgrPath = (string)keyAppMgr.GetValue(null);
                // Run CeAppMgr.exe to install the files to the device
                System.Diagnostics.Process.Start(appMgrPath, "\"" + @"E:\work\Experience\tech talk\tech talk\tech talk\Demo\setup\SetupMSI\CustomDll\SmartDeviceCab1\Debug\root.ini" + "\"");


    Version = 1.0
    Component = msicab

    Description = Sample
    CabFiles = SmartDeviceCab1.cab

    Best regards,
    Guang-Ming Bian - MSFT

    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Wednesday, April 29, 2009 7:35 AM
  • Hi MarkIsMobile,

    Since the thread will be expired, if you still can't solve it, please unmark it and feel free to let me know.

    Best regards,
    Guang-Ming Bian - MSFT
    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Monday, May 4, 2009 3:11 AM
  • Not sure I solved it so much, as simply found a work-a-round. 

    I appreicate your code snippet on creating the InstallerDLL (mine is very similar) but that does not appear to be the issue.  The problem seems to center around the Setup.ini file for some reason. 

    Using the same resources that go into a Setup Project (InstallerDLL, Setup.ini, CAB project, Executable project, etc., etc.) I receive an error if my Setup project comes from VS2008.  If I use VS2005 I do not receive the error.  There appears to be something about that ini file that VS2008 doesn't like ... format, attributes, ?, ??, ???. 

    Was curious if anyone new what it might be??

    Thanks Guang,

    Monday, May 4, 2009 3:21 AM
  • Hi MarKIsMobile,

    Can you show your InstallerDll and setup.ini code, I can test it.

    Best regards,
    Guang-Ming Bian - MSFT
    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Tuesday, May 5, 2009 2:56 AM