Deploy CF 2.0 CAB using project

I have the same problem. I've created a CAB project in VS 2005. After I add the project output to my File System on Target Machine, I see that it added mscorlib.dll, mscorlib.tlb, System.Data.Common, and System.dll. I tried to let those files in the Application directory and move them to the Windows directory, but my application won't run after it is installed. The other odd thing was that it added mscorlib.dll and System.dll for both version 1.0.5000.0 and 2.0.0.0. I tried to run the app with both versions and just the 2.0.0.0 version of the files.

It runs fine from the debugger, but then I see that Microsoft .NET CF 2.0, Miscrosoft .NET Compact Framework, Microsoft .NET CF 1.0 ENU-String, Microsoft .NET CF 2.0 ENU-String and Microsoft SQLCE 2.0 are installed. SQLCE does not appear in my files in my project output.

CF1 is in ROM so I don't really think that I need to reinstall that. Should I install the full CF 2.0 and if so where do I get the CAB file to do that Any other suggestions



Answer this question

Deploy CF 2.0 CAB using project

  • Chris Marts

    But of course it would fail as you have managed application running so files are in use and setup can't overwrite them.

    You can't launch installation of NETCF from NETCF based application, all managed applications much be terminated during NETCF installation.



  • P.Sanches Fernandes

    Sounds like a good plan to me.

    ATL template would d; however you probably don't really need ATL and would be better off with "Win32 Smart device project".

    It would be a simple console application with couple calls to CreateProcess() and some command line parsing like which CAB to install with which arguments and which application to invoke upon completion.



  • Luisfe

    I cannot use a desktop MSI file to install myApp because some of our users do not have a desktop computer. So I think that my best alternative will be to create a standalone autorun.exe C++ app that runs wceload to install the CF2 CAB file. Then the process can call my CF1 based install app to install the rest of the associated myApp CAB files as usual. Does this sound like a reasonable approach Is so, would I do this by creating a VS 2005 C++ ATL Smart Device Project or does that project only create a dll that can be called from another program
  • Whololo

    I have created a VS 2005 Wind32 Smart Device Project console program for autorun.exe. The return value from CreateProcess is 0, the lastError value is 87. Any help would be appreciated.

    void _tmain( VOID )
    {
    STARTUPINFO si;
    PROCESS_INFORMATION pi;

    LPTSTR szCmdline=_tcsdup(TEXT("\"wceload \\2577\\NETCFv2.ppc.armv4.cab\""));

    ZeroMemory( &si, sizeof(si) );
    si.cb = sizeof(si);
    ZeroMemory( &pi, sizeof(pi) );

    BOOL res=CreateProcess( NULL, // No module name (use command line)
    szCmdline, // Command line
    NULL, // Process handle not inheritable
    NULL, // Thread handle not inheritable
    FALSE, // Set handle inheritance to FALSE
    0, // No creation flags
    NULL, // Use parent's environment block
    NULL, // Use parent's starting directory
    &si, // Pointer to STARTUPINFO structure
    &pi ); // Pointer to PROCESS_INFORMATION structure

    int lastError;

    // Start the child process.
    if( !res)
    {
    lastError = GetLastError()
    printf( "CreateProcess failed (%d).\n", GetLastError() );
    return;
    }

    // Wait until child process exits.
    WaitForSingleObject( pi.hProcess, INFINITE );

    // Close process and thread handles.
    CloseHandle( pi.hProcess );
    CloseHandle( pi.hThread );
    }

  • OnuferT

    I have a similar issue, using RAPI to run the CAB..

    If I use CeCreateProcess I can launch exe's but when I try to launch a CAB it fails. The cab only seems to work when launched by hand.

    But......... if I followed this line of thought, I can get the CAB to run on the handheld.

    http://row1.info/content/view/85/2/

    The key seems to be that the cab will run from the ShellExecuteEx but not from CreateProcess, even if you implicity ask for WCELOAD to be used to launch the cab.

    If anyone has a direct solution that will allow CreateProcess to be used as a single call without needing a console app on the handheld, then advice appreciated !


  • u_r_twisted

    Yes you should depoy the full .NET CF 2.0 prior to your app.

    The CF 2.0 CAB files can be found in the following directory:
    C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\<OS>\<CPU>.

    The Windows Mobile 5.0 version is named 'NETCFv2.wce5.armv4i.cab'
    The Pocket PC 2003 version is named NETCFv2.ppc.armv4.cab'



  • Mets5157

    Thanks for the info Michael. If I run the CF2 CAB file by hand, it works.

    Currently I have a CF1 app that uses CreateProcess wceload.exe to run the CAB files associated with myApp. I upgraded myApp to use CF2, so now my install program which is a CF1 app is trying to run the CF2 CAB NETCFv2.ppc.armv4.cab. The CF2 installation fails with the error message.

    "Installation Error. Stop all applications and processes, maximize available storage space, and run installation again. Support info: 2."

    I think that I will have to have autorun.exe start a program that does not use CF1 that will install the CF2 CAB file. Then call my CF1 installation app. Do you think that's the problem.

    I have only made CF1 based smart device apps. If I need to create a new app, what other development platform should I use to develop the new app


  • Eric Brinkerink

    hi smaggi.

    I have similar problem. when i create my CAB project for .NET CF 2.0, it automatically copy the mscorlib.dll and mscorlib.tlh. Because of this two files my CAB file increases by 4 mb.

    if u get amy solution then please help me.

    thankx in advance.

  • Deploy CF 2.0 CAB using project