Deploy Application.CAB file and Compact Framework 2.0

Hi Everybody,

This is Chandra from New Zealand.

I am currently developing .NET CF 2.0 application on visual studio 2005 for windows mobile 5.0 platform.

I want to distribute my application along with .NET compact Framework 2.0 to the customer in Canada.

I created .CAB file for my application.But the problem is how can I include .NET compact framework 2.0 as well so that when the user runs my application.CAB file it also installs .NET compact Framework 2.0 along with the application.

I will be sending only my application.CAB file to my customer in canada and he will be installing the .CAB file on his device.

I want to deploy both my Application and CF2.0 to the device at one install.

I wont be having physical mobile device with me as it will be with the customer in canada.

plz help me as this is very very urgent for me to deploy it to the customer

Thanks very much

Chandra



Answer this question

Deploy Application.CAB file and Compact Framework 2.0

  • andris11

    Thanks ilya for your response. I have one more problem. I created MSI Installer and in that installer asked the user to enter the IP Address for the web service.I am able to get the value entered by the user while installing the app in the custom installer by using Context.Parameteres collection.The problem is, I want to pass this value from my custom installer to my actual PDA project so that users of this application will be connecting to the webservice with the IP Address entered by them while installing the application.

    Currently we include a .config file which contains static IP Address for the web service.If the user wants to point to a different server he will change the config file in the desktop and copy it over to PDA.but they want the entered IP Address to reflect in the .config file as it is not possible becoz .config file is already packaged in the .CAB file.

    Please help as I dont have a clue how to do this at all.

    Waiting for your response

    Chandra


  • bozo01

    You can not have CAB inside another CAB not because of NETCF, but because only one instance of WCELOAD is allowed. Since it's already running installing first CAB, you can not install second one.

    Owners of VS 2005 can redistribute NETCF MSI or individual NETCF CABs. So you can include NETCF ARM CAB (which one there are 4 ARM CABs in NETCF V2 SP1) with your application. You can even put it inside your CAB, too bad it won't work for the reason above.

    However you are not allowed to break CAB apart so there are no instructions on how to deploy NETCF individual bits because EULA prohibits that.



  • grellsworth

    Chandra, you are not alone, creating installers for PocketPC apps & automatically including the right CAB files for the right .netCF is a complete pain in the a*se.

    The examples I've seen for creating msi files are much too complex for a simple job.

    I use WinCE CAB manager to manage my cab files, and NSIS to package the cabs into a single exe, including the .netCF CAB, which I just install, without checking to see if it already exists.

    If you want more pointers on this, let me know and I'll post example scripts, etc.

    Microsoft are pretty good at lots of things, but pretty poor when it comes to making a simple installer



  • Bharat Gadhia

    Does anyone know how to do this

    I've got the exe file made, but no cabs are in it. Not sure what I'm doing wrong....


  • Sondre - MSFT Regional Director

    Hi Anarchy,

    Thanks for ur response.

    Can u please send me all the links to chandra.kotha@rhe.co.nz.

    One other question is I want to add my application to the start menu and it is adding it to start menu perfectly if start menu has fewer items. But when I add few more other windows apps to my start menu my application won't appear as we know it is due to start menu having a limited number of shortcut available to the user!

    Is there any way I can see how many items r there in the start menu and then remove one of those shortcuts and add my application short cut PROGRAMATICALLY.

    Thanks

    ur help is much appreciated.

    Cheers

    Chandra


  • DamsDev2007

    Thanks for theinfo Ilya. About the CAB in a CAB thing I was just thinking it would be neat if, when you made a deployment project, the CAB items could be included in your applications CAB, essentially placing a CAB within a CAB but only one instance of WCELOAD. So when owners of the VS2005 made a deployment project they could select the type of PDA they wished to deploy on and it would place the CF 2.0 inside. I realize this would be a lot of work but I bet it would save Microsoft on support issues . I know I have seen many posts about this CAB issue. Also while I am dreaming, why not put SQL CE as an option to build into your CAB as well

  • Henrik Karlsson

    OK OK. I see your point. It just that for the developer designing simple apps, such as us, that don't use anything fancy this was the easier choice. I agree it's important to keep pace, BUT I would have perferred that certain types of the CF 2.0 msi be allowed to be built directly into the app instead of depoyed seperatly. I am refering to ARM. Almost 100% of our development is deployed onto ARM processors. It would have been easier for us, and I think most developers, to have the option to include the ARM cab directly into the project. Alternatively if there was documentation telling me how to deploy the CF 2.0 (ie files, registry settings) I could have built them directly into my CAB. Unfortunatly I have not found these docs...

    Anyways I appreciate your opinion Ilya, I just wish I could have one cab...



  • Shihan

    Yes, Anarchy, i was would be interested too :)

    trystano@aol.com

    Tryst



  • Ian Morrish - MSFT

    That road leads strait to DLL hell; believe me you don’t want to go this way. NETCF needs to be a separate CAB so version integrity is preserved even if you have many applications using NETCF. I'm not even mentioning little problems like CABs digital signature which would be gone if you unpack it.

    There is a proven and effective solution: create an MSI (or other desktop installer) and deploy all required CABs one by one from it. It’s easy, transparent to users and does what it should. Normally you’d need an MSI for your application anyway, at that point one CAB or 10 - makes no difference.



  • joeydj

    I would be interested in this too. :)

    Thanks!

    Martina


  • shayc

    Chandra,

    Our company found deploying this CAB very inconvienient. Our customers would always skip over the install or , when we had to switch between the beta redistributable and the release, they would always get them mixed up between releases. We moved to building CF 1.0 apps instead. The CF 1.0 is already included on the ROMs of PPC 2003 and up so you don't have to install any CABs but your own if you are building simple applications. I don't know if this is a good suggestion for your company, but it sure saved us a lot of headaches.



  • sally_de

    Should everybody follow this path, we’ll still be using DOS 1.0.

    Besides, there are 4 versions of NETCF V1, unless you carry and install NETCF CAB of particular version with your application, you don’t know which version would be on device.

    You have to develop for RTM and workaround bugs fixed later on and you have to test your workarounds on all versions.

    I find that seriously more cumbersome than desktop installer which would simply push 2 CABs to the device and ensure you have correct version.



  • Tryin2Bgood

    For all those who would like to use NSIS as a multiple cab installer:

     

    NSI file:  yourapp.nsi

    ; NOTE: this .NSI script is designed for NSIS v1.8+

    Name "YourApp"
    Icon "YourIcon.ico"
    OutFile "YourApp_Setup.exe"

    ; Some default compiler settings (uncomment and change at will):
    ; SetCompress auto ; (can be off or force)
    ; SetDatablockOptimize on ; (can be off)
    ; CRCCheck on ; (can be off)
    ; AutoCloseWindow false ; (can be true for the window go away automatically at end)
    ; ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
    ; SetDateSave off ; (can be on to have files restored to their orginal date)

    InstallDir "$PROGRAMFILES\YourAppName"
    InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\YourApp" ""

    InstType "Full"
    ;InstType "Base"
    InstType /CUSTOMSTRING=Base
    ; The trick here is that we have only "Full" and "Base" types of installation
    ; NSIS knows the registered (with InsType) "Full" type. Any other combination
    ; of modules selected for installation is "Custom" - which we rename to "Base"
    ; because it's only one. (The main app is mandatory and the second is optional.)

    ComponentText "Select what you wish to install." "The type of install:" "Components to install:"

    Section "netcf"
    SectionIn 1
    SetOutPath "$INSTDIR"

    ; one-time initialization needed for InstallCAB subroutine
    ReadRegStr $1 HKEY_LOCAL_MACHINE "software\Microsoft\Windows\CurrentVersion\App Paths\CEAppMgr.exe" ""
    IfErrors Error
    Goto End
    Error:
    MessageBox MB_OK|MB_ICONEXCLAMATION \
    "Unable to find Application Manager for PocketPC applications. \
    Please install ActiveSync and reinstall YourApp."
    End:

    File netcf.ini
    File "C:\Path-toCab\netcf.core.ppc3.ARM.cab"

    StrCpy $0 "$INSTDIR\netcf.ini"
    Call InstallCAB

    SectionEnd ; end of section 'Optional'

    Section "SQLCE"
    SectionIn 1
    SetOutPath "$INSTDIR"

    File sqlce.ini
    File "C:\Path-toCab\sqlce.ppc3.arm.CAB"

    StrCpy $0 "$INSTDIR\sqlce.ini"
    Call InstallCAB

    SectionEnd ; end of section 'Optional'

    Section "YourApp" ; (default, requried section)
    SetOutPath "$INSTDIR"


    File YourApp.ini
    File "C:\Path-toCab\yourApp.ARM.CAB"


    StrCpy $0 "$INSTDIR\YourApp.ini"
    Call InstallCAB

    SectionEnd ; end of default section

     

    ; will insert a divider between the two sections with the "Optional" text on it
    ;SectionDivider "Optional"

     

     

     

    Section "-post" ; (post install section, happens last after any optional sections) ; add any commands that need to happen after any optional sections here
    WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\YourApp" "" "$INSTDIR"
    WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\YourApp" "DisplayName" "YourApp (remove only)"
    WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\YourApp" "UninstallString" '"$INSTDIR\uninst.exe"'
     

    MessageBox MB_YESNO|MB_ICONQUESTION \
      "Setup has completed. View readme file now " \
      IDNO NoReadme
       
      ExecShell open '$INSTDIR\readme.html'

      NoReadme:

      Quit
    SectionEnd ; end of -post section

     


    ; Installs a PocketPC cab-application
    ; It expects $0 to contain the absolute location of the ini file
    ; to be installed.
    Function InstallCAB

      ExecWait '"$1" "$0"'

    FunctionEnd


    ; eof

     

     

    ------------------------------

    Okay, now you will need (in this example) 3 ini files.  You need one ini file per cab you want to include:

     

    I have here:

    yourapp.ini

    sqlce.ini

    and

    netcf.ini

     

    They all basically look the same.  However, for each ini file, you have to change the component, description, Uninstall and cab files.  In other words, wherever you see SQLCE, you'd have to replace that with NETCF.  In the CABFiles line, you have to put the cab file you want to install - no path.  Then you can save it as netcf.ini..... 

     

    You also do this for your app cab.  So, wherever you see SQLCE, change it to "MyApp' (however you called your app), and don't forget to change the cab file.

    ---------------------------------------------

    [CEAppManager]
    Version      = 1.0
    Component    = SQLCE

    [SQLCE]
    Description  = SQLCE
    Uninstall    = SQLCE
    CabFiles     = sqlce.ppc3.arm.CAB


    -----------------------------------------

     

    You might need different cabs, but since my app needed 3 (netcf, sql and the program itself), I have 3 ini files.  You also need to be weary of the order that you write your code.  I found that NetCF had to be installed first, then SQL, and then my app, otherwise it didn't install correctly.

     

    I hope this helps.

     

    Martina

     


  • Charlie Audritsh

    You can not include NETCF CAB into yours, you need to install NETCF CAB separately. Common way is to create desktop installer which installs all required CABs via Active Sync.

    Alternatively you can instruct your customer to download and install NETCF from Microsoft’s web site or send required NETCF CAB along with yours.



  • Deploy Application.CAB file and Compact Framework 2.0