Use WinRAR to create the Windows Mobile Software PC installation package

Source: Internet
Author: User
Use WinRAR to create the Windows Mobile Software PC installation package  Are you sure you have created an installation package in Microsoft cab format?I don't need to talk about it here. In Microsoft's help file and msdn, I will explain a lot about how to compile. inf and how to package it. For example, you can search for the cabwiz or. inf keyword in EVC helps to find the relevant method. For example, you have prepared a sample. Cab installation package. WinRAR installedThis can be downloaded online. Remember to use the genuine version. Of course, you can also use WinZip or any compression software that can make self-extract (SFX. Compile a. ini fileThe file content is very simple. After writing it in notepad, save it as sample. ini [ceappmanager] version = 1.0 Component = sample [sample] Description = Installation Package example uninstall = samplecabfiles =./sample. Cab Prepare installpackage.exeInstallpackage.exe is a small program written by me. The principle is to find the location of the ceappmgr. EXE file in the registry. This file is the component used to install the program in ActiveSync, and then install it as a parameter. The program source code is as follows. The compiling environment is vc6.0. However, if you are using the source code, note that I use Unicode instead of the default MBCS macro of VC. Therefore, remember to remove MBCS from the C/C ++ option of the project, change it to _ Unicode, and replace it with Unicode. Of course, do not like friends can modify the source code, if you need to compile the file, please send to my mailbox nbcool@yeah.net request. Here, we would like to remind you that the current path symbol "./" is essential in executing installpackage.exe./xxx. ini with parameters. // Installpackage. CPP: defines the entry point for the application. // # include <windows. h> # include <tchar. h> lresult getceappmgrpath (lptstr * lpszpath); int apientry winmain (hinstance, hinstance hprevinstance, lpstr lpcmdline, int ncmdshow) {tchar szlpfile [max_path + 1]; DWORD dwlen = strlen (lpcmdline );//. INI file full path lptstr lpszceappmgr = NULL; If (dwlen> 0) {If (multibytetowide Char (cp_acp, 0, lpcmdline,-1, szlpfile, max_path )! = False) {If (succeeded (getceappmgrpath (& lpszceappmgr) {shellexecuteinfo execinf; zeromemory (& execinf, sizeof (execinf); execinf. cbsize = sizeof (execinf); execinf. fmask = see_mask_nocloseprocess; execinf. lpfile = lpszceappmgr; execinf. lpverb = text ("open"); execinf. lpparameters = szlpfile; If (shellexecuteex (& execinf )! = False) {// do nothing //} else {MessageBox (null, _ T ("Installer startup failed! "), _ T (" Setup Wizard "), mb_ OK | mb_iconerror);} else {MessageBox (null, _ T (" component loss, Installation failed! "), _ T (" Setup Wizard "), mb_ OK | mb_iconerror) ;}} if (lpszceappmgr! = NULL) {localfree (hlocal) lpszceappmgr);} return 0;} lresult getceappmgrpath (lptstr * lpszpath) {hkey = NULL; DWORD dwlength = 0; DWORD dwregtype = 0; lresult LR = s_false; lptstr lpszbuf = NULL; LR = regopenkeyex (HKEY_LOCAL_MACHINE, text ("software/Microsoft // windows // CurrentVersion // app paths // ceappmgr. EXE "), 0, key_query_value, & hkey); If (LR! = Error_success) {goto exit;} dwlength = 0; LR = regqueryvalueex (hkey, _ T (""), null, & dwregtype, null, & dwlength); If (LR! = Error_success) {goto exit;} lpszbuf = (lptstr) localalloc (lmem_fixed, dwlength * sizeof (tchar); If (lpszbuf! = NULL) {LR = regqueryvalueex (hkey, _ T (""), null, & dwregtype, (lpbyte) (lpszbuf), & dwlength); If (LR! = Error_success) {goto exit;} Exit: If (hkey! = NULL) {regclosekey (hkey);} * lpszpath = lpszbuf; return LR ;} Prepare an installation file iconThis is because cesetup. ICO is used. Start creating Installation Package First, the above files are placed in the same folder and the name is random.Sample.cabsample.inicesetup.icoinstallpackage.exe select a file, add it to the compressed file, select create a compressed file in the Self-extract format, set the self-extract option, and then select OK to generate the installation package. This article is complete, if you have any questions about the production process, you can raise them in the embedded part wince development.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.