Windows CE / Pocket PC mounting disk
By BlackColor 2002.02.21
Working environment: Microsoft EmbdvTools 3.0, Microsoft ActiveSync 3.1, Windows 98se, Microsoft Visual C 6.0, PDA is Lenovo 3000 (Windows CE 3.0 version, CPU is ARM SA1110)
The fabrication of the Windows CE / Pocket PC installation disk can be divided into the following steps. Before the detailed description, it is assumed that in C: has established a directory Sample, there is an exe file Sample.exe that has been compiled. Samples Source) and an ICO file Sample.ico.
First, prepare an INF file (Sample.inf), put it under C: / Sample, its format is as follows:
; PDA installation file: Sample.inf;
[Version] Signature = "$ Windows NT $" Provider = "Your company name" CESIGNATURE = "$ Windows CE $"
[CESTRINGS] AppName = "Your application name" installdir =% CE1% /% AppName%
[CEDEVICE] processype = 2577; CPU type is ARM SA11XX
[SOURCEDISKSNAMES] 1 =, "common files", Source; source file is under C: / Sample / Source
[SourceDisksfiles] sample.exe = 1; EXE file already compiled
[Defaultinstall] CopyFiles = files.installdiradDREG = regdataceshortcuts = links
[DestinationDirs] files.installdir =,% installdir% links =,% ce11% defaultDIR =,% installdir%
[Files.installdir] "PORDER.EXE", PORDER.EXE; will copy file
[Regdata] HKLM, Software / Microsoft /% AppName%, Majorversion, 0x00010001, 1HKLM, Software / Microsoft /% AppName%, MinorVersion, 0x00010001, 0
[LINKS] "Shortcut Name", 0, Sample.exe,% CE17%; create shortcuts in the start menu
Second, a CAB package with CabWiz.exe production, under CabWiz.exe file in the directory% evtoolsdir% / Windows CE Tools / wce300 / MS Pocket PC / support / ActiveSync / windows ce application installation / cabwiz, which is Microsoft EMBDVTOOLS% evtoolsdir% 3.0 installation directory, there is a file buildcab.bat in the superior directory of the directory, copy buildcab.bat to C: / Sample, modified to:
@echo offREMREM Sample batch file used to compile the CabWiz INF fileREMREMREM Replace
After the modification is completed, you can execute the buildcab.bat file, which will generate sample.cab.
Third, make an ini file install.ini, put it under C: / Sample, as follows:
[CEAPPMANAGER] Version = 1.0component = SAMPLE
[PORDER] Description = Description text iconfile = sample.icoiconindex = 0DeviceFile = sample.execabfiles = sample.cab
Fourth, connect the PDA to Windows 98se, enter the MS DOS mode, enter the installation directory of Microsoft ActiveSync 3.1 C: / Program Files / Microsoft ActiveSync, run as follows:
C: / Program Files / Microsoft ActiveSync> CEAPPMGR C: /sample/install.ini
The installer will start and install Sample.exe onto the PDA. If you feel that you have trouble every time, please refer to step five.
5. Creating a simple installation boot program using VC6 1. Open VC6 new project, select Win32 Application, "Project Name" in the Projects tab. 2. Second step Select "An Empty Project" and press the Finish button. 3. Create a new file install.cpp and join the project, as follows:
/ / -------------------------------------------------------------------------------------------- - // PDA installer (PCKET PC) // ------------------------------------- -------------
#include
int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {// get its path char szPath [MAX_PATH]; GetModuleFileName (NULL, szPath, MAX_PATH-1); // ini file name converted int iLen = Strlen (SZPATH); STRCPY (& SZPATH [ILEN-3], "Ini"); // Take CEAPPMGR.EXE's full path hkey hresult; char szceappmgr [] = "Software // Microsoft // Windows // CurrentVersion // APP Paths // CEAppMgr.exe "; LONG iRet = RegOpenKeyEx (HKEY_LOCAL_MACHINE, szCEAppMgr, NULL, KEY_READ, & hResult); BYTE szCEAppMgrExe [MAX_PATH * 2 1]; if (iRet == ERROR_SUCCESS) {DWORD cbName, dwType; cbName = MAX_PATH ; dwType = REG_SZ; iRet = RegQueryValueEx (hResult, NULL, NULL, & dwType, szCEAppMgrExe, & cbName); RegCloseKey (hResult);} if (! iRet = ERROR_SUCCESS) {MessageBox (NULL, "! install Microsoft ActiveSync software" "Error", MB_ICONERROR); RETURN 1;} char szexe [max_path * 2 2]; strcpy (szexe, (char *) szceAppmgrexe);
// start the installation SHELLEXECUTEINFO ExecInfo; memset ((char *) & ExecInfo, 0, sizeof (ExecInfo)); ExecInfo.cbSize = sizeof (ExecInfo); ExecInfo.fMask = SEE_MASK_CLASSKEY; ExecInfo.hwnd = NULL; ExecInfo.lpFile = szExe; Execinfo.lpparameters = szpath; execinfo.nshow = sw_show;
ShellexecuteEx (& Execinfo);
Return 0;}
4. Copy the compiled exe file install.exe, copy to the C: / Sample directory, run install.exe to automatically install the above software.
Sixth, explanation 1. More detailed information Please refer to Microsoft EmbdvTools 3.0 online help, Microsoft EmbdvTools 3.0 can be available free of charge by Microsoft. 2. Only one PDA in my hand, I didn't test the other models of PDA. 3. The copyright of this article belongs to the original author. Please indicate the source and maintain the integrity of this article.