Create Device Installer: Difference between revisions
(Created page with "==Create a CAB file== Assume we have the following solution: Image:CAB(2).PNG and we want to include a project to create the cab installer for our application, which shou...") |
No edit summary |
||
Line 81: | Line 81: | ||
[[Image:CAB (18).png]] | [[Image:CAB (18).png]] | ||
We are ready to ship our application and distributing it. If you want to test it (highly recommendable), you can copy it to the emulator (or share de folder to make it visible from the emulator as a Storage Card) or to the device and install it. You can also uninstall it | We are ready to ship our application and distributing it. If you want to test it (highly recommendable), you can copy it to the emulator (or share de folder to make it visible from the emulator as a Storage Card) or to the device and install it. You can also uninstall it through the Remove Programs option. | ||
[[Category:WI 287575 EPOD Development and Release Process]] |
Revision as of 11:53, 9 September 2011
Create a CAB file
Assume we have the following solution:
and we want to include a project to create the cab installer for our application, which should:1) Copy DeviceCoolApp.exe, the referenced assembly MyDeviceLibrary.dll and the resource file called SampleKindOfResourceFile.xml to the application folder.2) Additionally, it should create a shortcut in the Programs folder on the device and3) Set the string value HKLM\Software\Mobile Practices\DeviceCoolApp\Version to "1.0".
First of all, we need to add a new Smart Device CAB Project to the solution: Right click on the solution, Add - New Project...
Call it DeviceCoolAppInstaller and press OK. The new project will appear at the bottom in the Solution Explorer window.
Now, I recommend we change the project properties to get a *nice* product installation. Set the Manufacturer (Mobile Practices) and Product Name (DeviceCoolApp) as follows:
It's time to add DeviceCoolApp.exe (the DeviceCoolApp project output) to the CAB Project. Right click on DeviceCoolAppInstaller - Add - Project Output...
Select DeviceCoolApp on the Project selector, and Primary Output as follows, and press OK.
Visual Studio will detect automatically the DeviceCoolApp dependencies. In this case it will detect MyLibrary.dll
**If the dependencies are not detected, you can rebuild the solution and then Right Click on Detected Dependencies - Refresh Dependencies.
As you can see, due to the automatic dependencies detection, we don't need to add MyDeviceLibrary as Project Output on DeviceCoolAppInstaller.
Now it's time to add the resource file SampleKindOfResourceFile.xml which should be installed on the Installation folder. Let's use the File System Editor, having the DeviceCoolAppInstaller project selected press the File System Editor button (btw, it's probably already open).
Now, right click on Application Folder - Add - File....
Browse and find SampleKindOfResourceFile.xml and press OK.
Congrats!, now we have all the necessary files ready to be installed. The next step is to add the shortcut.
Unfortunately, the Programs Folder is not already included on the File System Editor, and we need to include it manually: Right click on File System on Target Machine - Add Special Folder - Programs Folder.
And now, select Programs Folder on the File System tree, and right click on the empty panel at right and select Create New Shortcut
And select Application Folder - Primary output from DeviceCoolApp (Active) and press OK.
And rename it to "Device Cool App"
This will be the application shortcut on the Programs group on the smart device after installation. Now we just have to add the registry entry. Press the Registry Editor button:
And add the string value "HKLM\Software\Mobile Practices\DeviceCoolApp\Version". You need to create the path key by key, and the add the string value on the right panel.
Name it "Version" and then, select it, and enter "1.0" into the Value field on the Properties Window
And *voila* the Smart Device CAB Project is done! We're ready to build the solution, right click on the DeviceCoolAppInstaller project and select Build.
You can find the DeviceCoolAppInstaller.cab file in the DeviceCoolAppInstaller\debug folder.
We are ready to ship our application and distributing it. If you want to test it (highly recommendable), you can copy it to the emulator (or share de folder to make it visible from the emulator as a Storage Card) or to the device and install it. You can also uninstall it through the Remove Programs option.