Generate a Smartphone installation package in Visual Studio.net

xiaoxiao2021-03-06  42

Generate a Smartphone installation package in Visual Studio.net

Now how to make a SmartPhone installation package, it has become a common problem. In SmartPhone, the CAB file is a standard installation file. After the installation is over, the CAB file will be automatically deleted. Typically, the package of Windows Mobile programs is used using the Cabwiz program. The option to generate the CAB file is provided in Visual Studio.NET and can be run correctly in the Pocket PC program, but it will be an error in smartphone. Here, we realize a Smartphone installation package in Viusal Studio.NET by modifying several profiles.

First, we open a Smartphone solution (SLN file), select "Release" and select "Generate Solution" under the "Generation" menu. If the build process is correct, select "Generate CAB File" under the Generation menu.

Then, we entered the OBJ / Release directory in the project's file directory, we can see the buildcab.bat and xxxx_smp.inf files (XXXX represents the project name), as well as generated executables. If the executable needs to be confused, the confused executable can replace the executable of the directory.

Let's right-click the buildcab.bat file, select Edit, you can edit the BAT file. The first part of the BAT file is "C: / Program Files / Microsoft Visual Studio .NET 2003 / CompactFrameworksDK / V1.0.5000 / Windows CE / Smartphone /../ bin /../ BIN / CABWIZ.EXE", but smartphone The package file is CabwizSp, we can find it in the Tools directory of the SMARTphone's SDK. So replace the above part to "C: / Program Files / Windows CEOLS / WCE420 / Smartphone 2003 / Tools / CabwizSp.exe". Then save the buildcab.bat file.

Then we open the xxxx_smp.inf file, this is a standard INF file. We can write the names of the company or developer in the provider in [Version]; write the program name into the AppName under [CEStrings].

We also need to modify the two wrong file paths. [SourceDiskSNames.armv4] is changed to 4 =, "armv4_setup", "C: / Program Files / Microsoft Visual Studio .NET 2003 / CompactFrameworkSDK / V1.0.5000 / Windows CE / WCE400 / ARMV4 /". [SourceDisksnames.x86] is changed to 6 =, "x86_setup", "C: / Program Files / Microsoft Visual Studio .NET 2003 / CompactFrameworksDK / V1.0.5000 / Windows CE / WCE400 / X86 /". In this way, it will not report it if you run BuildCab.bat.

You can also modify the file according to the INF standard. But you need to remind everyone that Chinese cannot use Chinese in the INF file of the SmartPhone project, otherwise an error will be reported. There is no such problem in the Pocket PC project.

After the modification is complete, we execute the buildcab.bat file. Note that after modifying the buildcab.bat and xxxx_smp.inf files, do not perform the "Generate Cab File" command in the IDE environment. Otherwise, vs.net will regenerate the buildcab.bat and xxxx_smp.inf files. After BuildCab.bat is completed, we can find xxxxx_smp.armv4.cab and xxxx_smp.x86.cab files in the CAB / Release directory under the project directory. Cabwiz.smp.log records the operation information of CabwizSP. Where armv4.cab runs in the actual device, the x86.cab file is running in the simulator.

We connect smartphone to your PC and copy the CAB file to "/ Storage / Windows / Star Menu via ActiveSync. Then we in Smartphone, select the "Start" menu, find the CAB file in the menu, execute, you can complete the installation of the program.

In this way, after each Build program, the IDE automatically copies the latest executable to the OBJ directory, you can get the SMARTPHONE installation package when you perform BuildCab.bat. Aawolf original, reprint, please note the original: blog.9cbs.net/aawolf

转载请注明原文地址:https://www.9cbs.com/read-55415.html

New Post(0)