none
Problem with Multicab Install

    Question

  • Hi All,

     

    1. I tried out the sample code provided in the Windows Mobile SDK samples folder.

    I followed the steps to create a "uber" cab and created one which contains the multicab.exe, setup.dll, myapp.cab and netcf.cab.

    I deployed the uber cab to a Window Mobile 5.0 phone, and though the uber cab was deployed successfully, none of the contained CABs

    were unpacked. I see the uber cab unpacked under \Program Files\UberCab though.

    I created the registry keys just as documented in the readme provided with the sample.

    The install showed a success message at the end, but my application or the .net 2.0 framework was not installed on the device.

     

    2. I tried out the Live Search app on a Windows Mobile 5.0 phone and looks like the .NET CF 2.0 cab is fetched from the web instead of packaging it inside the main CAB. Does this still require CAB chaining of some sort? How does this work if the .NET CAB is not packaged.

     

    Thanks in advance!

    Saturday, January 31, 2009 1:32 AM

Answers

  • You don't need to auto launch it - user would launch it, only at that point NETCF would be downloaded and installed if needed.
    Though if you want to - you can launch the EXE from setup DLL. That, however,  would create very same complications as with uber-CAB.
    In fact it's going to be exactly the same approach, only without any registry entries (which are not really needed for uber-CAB).

    Yes, you will not need a setup DLL - at all. EXE would install NETCF without need to invoke any DLLs.

    Here's the flow:

    void main()  
    {  
        if (!IsNetfInstalled())                                       // Implement it by checking registry.  
        {  
            CreateProcess(whateverIsNeededToInatallNetcf);            // E.g. launch pocket IE with URL to NETCF CAB on your site  
            WaitForInstallationToComplete();                          // E.g. check for NETCF presence in a loop every 10 seconds, exit if not installed in, say, 10 minutes.  
        }  
     
        CreateProcess(yourActualManagedApp);  
    }  
     



     


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Ka$h Monday, February 02, 2009 8:00 AM
    Sunday, February 01, 2009 10:09 PM
    Moderator

All replies

  • Live Search is using native shim to start the application which first checks if NETCF is installed and installs it if not. This approach is much better than uber-CAB.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Saturday, January 31, 2009 4:57 AM
    Moderator

  • Do you mean create a setup.dll included in the application CAB (like the one included in the samples) which checks if .NET CF is installed and make an HTTP fetch to get the .net cf dll hosted somewhere?

    Is the approach you suggested better since it does not bloat the main CAB or is there something else to it?

    Thanks!
    Sunday, February 01, 2009 2:29 AM
  • No. Create an EXE (in C++) which your user would start, e.g. via shortcut. It would then check if NETCF is installed or not. If not it then would install NETCF via whatever means. If it is installed it would just launch your managed application and terminate.

    This approach is better not just because it does not bloat the CAB but because it does not hit WCELOAD limitation which only allows for one CAB to be installed at a time. Nested CAB sample is trying to work around that limitation by launching an EXE which then waits for uber-CAB installation to finish so it can install nested CABs. As you probably noticed it does not work that well.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Sunday, February 01, 2009 7:14 AM
    Moderator
  • Thanks Ilya..
    Just another question...
    I had actually put the code for NETCF detection in a setup.dll.
    I see your point about placing the .NET CF detection code in an exe and it seems like a better approach since I can create a shortcut to it as you mentioned.
    But with a setup dll, I can specify it in the "CE setup dll" property of the CAB file which makes it startup as soon as the CAB file is clicked.
    How do I do this with an exe i.e. how do I make it auto launch when the CAB file is downloaded and clicked on?

    Also, will I not need a setup dll to install the .NET CF CAB once it is fetched?  Can the exe invoke the setup dll?
    Sorry I haven't worked much with native code before and I'm still confused about the flow. Would you have some sample code for this? Would be very helpful!

    Thanks again!


    Sunday, February 01, 2009 8:41 PM
  • You don't need to auto launch it - user would launch it, only at that point NETCF would be downloaded and installed if needed.
    Though if you want to - you can launch the EXE from setup DLL. That, however,  would create very same complications as with uber-CAB.
    In fact it's going to be exactly the same approach, only without any registry entries (which are not really needed for uber-CAB).

    Yes, you will not need a setup DLL - at all. EXE would install NETCF without need to invoke any DLLs.

    Here's the flow:

    void main()  
    {  
        if (!IsNetfInstalled())                                       // Implement it by checking registry.  
        {  
            CreateProcess(whateverIsNeededToInatallNetcf);            // E.g. launch pocket IE with URL to NETCF CAB on your site  
            WaitForInstallationToComplete();                          // E.g. check for NETCF presence in a loop every 10 seconds, exit if not installed in, say, 10 minutes.  
        }  
     
        CreateProcess(yourActualManagedApp);  
    }  
     



     


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Ka$h Monday, February 02, 2009 8:00 AM
    Sunday, February 01, 2009 10:09 PM
    Moderator
  • Ilya, thanks a ton for the clear and concise explanation! I was able to create a prototype with this approach, but am facing some problems with it:

    1. I have implemented the WaitForInstallationToComplete functionality in a separate thread. This thread polls for .NET CF presence every 10 seconds. I've used WaitForSingleObject to implement the timeout of 10 mins. The problem with this step is that when the .NET CF CAB install starts and is half way through, this piece of code detects the registry key for .NET CF 2 and exits the loop and starts my application via CreateProcess, before the .NET CF 2. 0 installation is complete. Is there a way to wait for the installation to be fully complete before launching my app?

    2. I created a CAB file which packages the setup exe and my app exe along with the dependencies. I have created a shortcut to the setup.exe.
    Now when I deploy the CAB file and it installs the app, clicking on the shortcut gives me an error stating that setup.exe or its libraries could not be located. I verified that the files are unpacked properly under the Application folder and the .lnk file points to the proper location of setup.exe.
    This does not happen when I create a shortcut directly to myapp.exe (managed app). Are there any additional steps I've missed in creating a shortcut to the setup.exe?

    3. When the .NET CF CAB is fetched and is installed, it prompts for a restart of the phone. As you mentioned earlier, this is a bug in the Windows Mobile cabwiz. Is there a way to suppress this restart dialog? I searched through the forums for this and someone mentioned about using a /norestart switch, but there was no mention of how or where to set this switch. Is there a way I can suppress the restart dialog and not display the prompt to the user?

    Thanks!

    Monday, February 02, 2009 4:41 AM
  • Just an update..

    2. Resolved. My active configuration for the setup exe was set to WM 6.0 Standard, while I was running it on the WM 5.0 emulator. I'm not sure why it worked fine on the WM 5.0 smartphone emulator as a standard exe but failed to run when packaged into a CAB.  But this has been resolved for the time being by changing the active config to WM 5.0 smartphone.

    Thanks!
    Monday, February 02, 2009 8:18 AM