Answered Deploying Multiple cab files at once

  • Friday, February 09, 2007 4:55 PM
     
     

    I have developed my application and created the .cab file for this application.  I followed the tutorial on creating an MSI file and custominstaller and this works fine.  My problem comes from the fact that my application must also install .NET framework 2.0 and the SQLMobile .Cab file. 

     I am wanting to package all of these together and be able to deploy them at one time from a users PC.  I am not wanting to make the user click on each cab file to execute them. 

    Can anyone point me in the direction of a good tutorial to accomplish this, or give me a good idea on how to do it. 

    Thanks for any help

Answers

  • Tuesday, February 13, 2007 10:39 PM
    Moderator
     
     Answered

    Please try this:

    System.Diagnostics.Process.Start(appMgrPath, "\"" + Path.Combine(installPath, ceappmgr_INI_File_NET) + "\"").WaitForExit();

    In VB it looks like this:

    System.Diagnostics.Process.Start(appMgrPath, "\"" + Path.Combine(installPath, ceappmgr_INI_File_NET) + "\"").WaitForExit()

    By the way, you can create installer DLL in VB if you having issues with C#. 

     

All Replies

  • Friday, February 09, 2007 5:04 PM
    Moderator
     
     
  • Friday, February 09, 2007 8:50 PM
     
     

    Can I use installer.dll to do what I am wanting to do.  If I create different .cab projects and different .INI files and use them in the installer.dll.   would this work to do what I want it to do.

    I have seen people talking about the setup.dll file.    If this is my best option.  Is there anywhere that I may be able to get some sample code to try to do it that way.

  • Saturday, February 10, 2007 12:58 AM
    Moderator
     
     

    You best bet is deploy CABs one by one via CeAppMgr and INI files.

    Nested CABs is rather theoretical possibility – I’ve never seen and practical implementation.

  • Monday, February 12, 2007 2:10 PM
     
     
    Ok,  I have gone through a good deal of msdn pages and have not found a good example of how to do this.  Do I just add multiple INI files to my msi project.
  • Monday, February 12, 2007 5:03 PM
    Moderator
     
     

    Yes, you add them and repeat the same thing you've done with the first INI for each INI you have.

    Sample which does the right thing with one INI can be found here. You can do something like this:

     

    // Run CeAppMgr.exe to install the files to the device
        System.Diagnostics.Process.Start(appMgrPath,
            "\"" + Path.Combine(installPath, CEAPPMGR_INI_FILE) + "\"");

    // Run CeAppMgr.exe to install the files to the device
        System.Diagnostics.Process.Start(appMgrPath,
            "\"" + Path.Combine(installPath, CEAPPMGR_INI_FILE_1) + "\"");

    // Run CeAppMgr.exe to install the files to the device
        System.Diagnostics.Process.Start(appMgrPath,
            "\"" + Path.Combine(installPath, CEAPPMGR_INI_FILE_2) + "\"");

    // Run CeAppMgr.exe to install the files to the device
        System.Diagnostics.Process.Start(appMgrPath,
            "\"" + Path.Combine(installPath, CEAPPMGR_INI_FILE_3) + "\"");

    ...

     

    }

    You can also register all INIs with CeAppMgr and then invoke them. MSDN has description of that.

  • Monday, February 12, 2007 10:43 PM
     
     
    I tried this a couple of times and it did absolutely nothing.  as long as there is only one, it works fine.  but it seems to do nothing.  It doesnt even install the initial system that was installing before I made that change.  Is there a link to registering all INIs information.
  • Monday, February 12, 2007 11:29 PM
    Moderator
     
     

    It probably would work if you add some code to wait for CeAppMgr to exit before running next INI.

    Here's the search query for the link, I believe it's the first one in the list.

    http://search.msdn.microsoft.com/search/default.aspx?siteId=0&tab=0&query=register+INI+CeAppMgr

  • Tuesday, February 13, 2007 2:49 PM
     
     
    I have looked at a great deal of information on the Install_Init and Install_Exit functions and that seems like where I need to be working.  The problem is, I have no idea where those two functions are,  are they in the installerDLL or somewhere else.  I have also never seen, that I know of, and source code examples for this.  can someone explain Install_Init and Install_Exit functions to me and where to find/use them. 
  • Tuesday, February 13, 2007 5:17 PM
    Moderator
     
     

    These functions are indeed in optional setup DLL which lives inside a CAB file and runs on device while CAB is installed. So it's irrelevant to the desktop side installer. There's sample code for CAB setup DLL in WM SDK (C++ as it must be native).

  • Tuesday, February 13, 2007 9:19 PM
     
     
    I was playing with the idea of doing this from installerDLL from the before mentioned method

     System.Diagnostics.Process.Start(appMgrPath, "\"" + Path.Combine(installPath, ceappmgr_INI_File_NET) + "\"");
                System.Diagnostics.Process.Start(appMgrPath, "\"" + Path.Combine(installPath, ceappmgr_INI_File2) + "\"");
                System.Diagnostics.Process.Start(appMgrPath,"\"" + Path.Combine(installPath, CEAPPMGR_INI_FILE) + "\"");
              

    This is working to an extent.  It sometimes gives me an error and sometimes installs 1 or 2 or all 3 cab files.  What I want to do is pause the system in between the starts and check the process continually until it is finished then start the next one.  I have never written an C# code, so I will need some help.  How do I check to see if a process is still active and running or done.  also how would I pause the installerDLL.  something like untilll process is stopped do nothing.  Once the process is stopped, start the next one.
  • Tuesday, February 13, 2007 10:39 PM
    Moderator
     
     Answered

    Please try this:

    System.Diagnostics.Process.Start(appMgrPath, "\"" + Path.Combine(installPath, ceappmgr_INI_File_NET) + "\"").WaitForExit();

    In VB it looks like this:

    System.Diagnostics.Process.Start(appMgrPath, "\"" + Path.Combine(installPath, ceappmgr_INI_File_NET) + "\"").WaitForExit()

    By the way, you can create installer DLL in VB if you having issues with C#. 

     

  • Thursday, February 15, 2007 3:50 PM
     
     
    This seemed to work. Thank you.

    Now I have to check to see if the user has an SD card in, and if so, install pictures on it. Can you force the installation to install onto an SD card. Or better yet, force a cab file to use the SD card.
    and if so, how do you determine if it is called SD Card or Storage Card. 

  • Thursday, February 15, 2007 4:28 PM
     
     

    Could you provide full code for the deployment stages ?

    Please ?

    maybe email me @ jason.jones@cornerkey.com

    or even maybe try and answer this quetsion hehe

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1232744&SiteID=1

    Many Thanks in advance!!!

  • Thursday, February 15, 2007 5:34 PM
    Moderator
     
     

    CAB installer would determine if storage card is available on device upon installation and user would have the opportunity to install on to it.

  • Thursday, February 15, 2007 7:28 PM
     
     
    Right, but there are to many pics to put on the pda, they will have to be installed onto the SD Card.  I need to check and see if there is a card available. 
  • Thursday, February 15, 2007 8:04 PM
    Moderator
     
     

    There's no good way to do it. Besides you should not force user to install to storage card - you never know how much storage is available on device. May be we’ll see devices with gigabytes of storage soon… 

     

    Just let user and WCELOAD (CAB installer on device) handle it – it should put up a warning if there’s not enough space.

  • Thursday, February 15, 2007 8:49 PM
     
     
    right, but there are so many pictures that they can only go on a storage card.  Is there anyway to force it to the sd card.
  • Thursday, February 15, 2007 8:53 PM
    Moderator
     
     
    No.
  • Friday, February 16, 2007 1:58 PM
     
     
    I then need to determine whether the users device call it SD Card or Storage Card.  That will determine which cab file to use.  Is there a way to do this from the installerDLL.
  • Friday, February 16, 2007 3:43 PM
     
     

    cant you just check if dir exists ?

    if(Directory.exists(Storage Card\))

     

    ?? 

  • Friday, February 16, 2007 6:38 PM
    Moderator
     
     

    I consider this thread answered and done. Please open a new thread on how to check for storage card from desktop.

  • Wednesday, February 21, 2007 11:56 AM
     
     

    I have seen that http://msdn2.microsoft.com/en-us/library/aa446504.aspx.

    It tell me that how to Deploying .NET Compact Framework 2.0 Applications with .cab and .msi Files.

    But I want to create the .msi file which package not noly my applications but also cf 2.0?

    please tell me how to do it.

    thank you very much.

  • Thursday, February 22, 2007 2:11 PM
     
     
    I think I did what you are wanting to do.  my msi file deploys my SQL cab, netcf cab, and my app cab.  in my msi file system editor I put the cab files and the INI files I created in the temp folder that I created from the tutorial.  Then in my custom installer I did what we mentioned above with the WatiToExit() thing.  this seems to work for me.
  • Sunday, November 25, 2007 5:05 AM
     
     

    Thank you.

     

    The WaitForExit() is the key.  I am now able to deploy .NET CF 2.0, SQL Server Compact Edition, my barcode scanner vendor's software, and my application reliably.  The only thing that I would like to eliminate is the "Check your device screen for additional action..." message after each CAB.

     

  • Tuesday, January 08, 2008 6:31 AM
     
     

    I have tried my code like that in the following, but I still only got eithor one cab file installed most of times or rarely 2 cab files.  It is not reliable for me at all. WaitForExit() method seems not work for me. What else can possible go wrong? I am using ActiveSync 4.5 on XP. My device is WM5.0 with CF 2.0.

     

    BTW, The only way for me to deploy mutiple cab files reliably is registering all cab files first then invoke CEAppMgr. But I can not let customers pick all needed components manually from pop up window.

     

    proc = System.Diagnostics.Process.Start(this.AppManager,
                        "\"" + GetIniPath("Setup_SqlCe30.ini") + "\"");
                    proc.WaitForExit();

                    proc = System.Diagnostics.Process.Start(this.AppManager,
                        "\"" + GetIniPath("Setup_MyApp.ini") + "\"");
                    proc.WaitForExit();

     

           private string GetIniPath(string setupFile)
            {
                return (Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), setupFile));
             }

    Thanks lot for your help,