Issue:
Using setup.dll in my applications CAB to install support CABs (ie:
sql.ppc3.arm.CAB and sqlce.ppc3.arm.CAB).
I am trying to provide backwards compatibility for Microsoft Mobile 5.0 OS.
A little history.I developed a mobile application that ran perfect on Dell
Axim versions 5.0 and earlier on Windows CE version OS. Now that our clients
are purchasing Dell Axim 5.1/5.1v the app fails. This is because the OS was
"upgraded" to Windows Mobile 5.0 for these new devices, which includes
Compact Framework 2.0 also upgraded.
To resolve the failure; I downloaded the Microsoft Visual Studio 2005 and
re-compiled my application/s. I adjusted references to library components as
needed and I added a CAB project. Made a few edits in the .inf and put the
package together.
Everything installs on the mobile device BUT the supporting CABs (mentioned
above) do NOT automatically install as they did before. I will get "compact
frame work" related errors until I manually initiate install of the
additional CABs. Then everything works fine. No changes to the setup.dll
code were made except I re-compiled in VS '05 for support on Windows Mobile
5.0 Pocket PC SDK (ARMV4I).
Question:
Is there sample C++ code that shows how to create a setup.dll for Mobile 5.0
that will auto install multiple supporting CABs and will run on Mobile 5.0
OS?
I'm only running one instance of wceload.exe. I get its handle, run one CAB
and finish, then run subsequent.Here is a simple example of code in my dll:
// Sample CESetup DLL
#include <windows.h>
#include <tchar.h>
#include "ce_setup.h"
#include <winbase.h>
const TCHAR szTITLE[] = TEXT("CESetup Sample DLL");
const TCHAR szINST_INIT[] = TEXT("Install_Init\n\nContinue?");
const TCHAR szINST_EXIT[] = TEXT("Install_Exit\n\nContinue?");
const TCHAR szUNINST_INIT[] = TEXT("Uninstall_Init\n\nContinue?");
const TCHAR szUNINST_EXIT[] = TEXT("Uninstall_Exit");
const TCHAR szError[] = TEXT("Error");
BOOL WINAPI DllMain(HANDLE hMod, DWORD dwReason, LPVOID lpvReserved)
{
return TRUE;
}
codeINSTALL_INIT Install_Init(
HWND hwndParent,
BOOL fFirstCall,
BOOL fPreviouslyInstalled,
LPCTSTR pszInstallDir)
{
return codeINSTALL_INIT_CONTINUE;
}
codeINSTALL_EXIT Install_Exit(
HWND hwndParent,
LPCTSTR pszInstallDir,
WORD cFailedDirs,
WORD cFailedFiles,
WORD cFailedRegKeys,
WORD cFailedRegVals,
WORD cFailedShortcuts)
{
DWORD dwError = NOERROR;
PROCESS_INFORMATION pi = {0};
LPWSTR lpExe = TEXT("\\windows\\wceload.exe");
LPWSTR lpCmdLine = TEXT("\\windows\\sql.ppc3.arm.cab");
CreateProcess(lpExe, lpCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, NULL,
&pi);
if (pi.hProcess)
CloseHandle (pi.hProcess);
if (pi.hThread)
CloseHandle (pi.hThread);
Sleep(10000);
lpCmdLine = TEXT("\\windows\\sqlce.ppc3.arm.cab");
CreateProcess(lpExe, lpCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, NULL,
&pi);
if (pi.hProcess)
CloseHandle (pi.hProcess);
if (pi.hThread)
CloseHandle (pi.hThread);
return codeINSTALL_EXIT_DONE;
}
codeUNINSTALL_INIT Uninstall_Init(HWND hwndParent, LPCTSTR pszInstallDir)
{
return codeUNINSTALL_INIT_CONTINUE;
}
codeUNINSTALL_EXIT Uninstall_Exit(HWND hwndParent)
{
return codeUNINSTALL_EXIT_DONE;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
I left out some fat so it is easy to read.Thanks to anyone how can point me
in the right direction!!
Chuck
P.S
I hope I get an answer because I would hate to keep posting this for the
rest of my life until I do :-)
--
Charcoal
Going Mobile...Keep me moving.