NSIS for Smartphone: Difference between revisions
No edit summary |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
You can compile a setup launcher which will install multiple CAB files to Windows Mobile-based Smartphone using the Nullsoft Scriptable Install System (NSIS).<br> | You can compile a setup launcher which will install multiple CAB files to [http://n.domaindlx.com/mssmartphone Windows Mobile-based Smartphone] using the Nullsoft Scriptable Install System (NSIS).<br> | ||
[[File:Snap1553.gif]] | [[File:Snap1553.gif]] | ||
<br> | <br> | ||
Line 73: | Line 73: | ||
Try this '''sample setup launcher''' <attach>Multi.Cab.Install.zip</attach> | Try this '''sample setup launcher''' <attach>Multi.Cab.Install.zip</attach> | ||
<BR><BR> | |||
<B>---ADDENDUM---</B> | |||
Cleaner Method. | |||
[[Category: | While the above method works just fine, I would like to point out that the same result can be achieved without having the 'Add / Remove Programs' dialog pop up three times, which can be confusing and unfriendly to stupi...errr...<I>Less Experienced</I> users - it can be done much more cleanly in one dialog. This is also a better solution when you are installing dependencies (i.e: If you need to have the .Net compact framework installed before your main app). | ||
To do this, take the above installscript, and modify it thusly: | |||
<highlight-nsis> | |||
StrCpy $0 "$INSTDIR\1.ini" | |||
;Call InstallCAB <-- Comment out this line | |||
SectionEnd ; | |||
Section "File 2" | |||
SectionIn 1 | |||
SetOutPath "$INSTDIR" | |||
File 2.ini | |||
File 2.CAB | |||
StrCpy $2 "$INSTDIR\2.ini" ;<-- $2 instead of $0 | |||
;Call InstallCAB <-- Comment out this line | |||
SectionEnd ; | |||
Section "File 3" | |||
SectionIn 1 | |||
SetOutPath "$INSTDIR" | |||
File 3.ini | |||
File 3.CAB | |||
StrCpy $3 "$INSTDIR\3.ini" ;<-- $3 instead of $0 | |||
Call InstallCAB | |||
<SNIP!> | |||
Function InstallCAB | |||
ExecWait '"$1" "$0" "$2" "$3"' ;<-- Extra parameters '$2' and '$3' Here | |||
FunctionEnd | |||
</highlight-nsis> | |||
<B>What This Achieves:</B> | |||
The PDA CAB Files are installed by calling CEAppMgr.exe with the cab files as command-line parameters. In the main article, this is accomplished by calling CEAppMgr three times to install Three Cab Files. With my changes, instead of calling ceappmgr three times: | |||
CeAppMgr 1.cab<BR> | |||
CeAppMgr 2.cab<BR> | |||
CeAppMgr 3.cab<BR> | |||
it calls it once: | |||
CeAppMgr 1.cab 2.cab 3.cab | |||
CEAppMgr can handle multiple cab files in one go, thus is installs all three CAB files through one dialog. | |||
If you want to change the order in which they get installed, i.e if 2.cab required that 3.cab was already installed, just change the order. e.g: | |||
<highlight-nsis> | |||
Function InstallCAB | |||
ExecWait '"$1" "$0" "$3" "$2"' | |||
FunctionEnd | |||
</highlight-nsis> | |||
Thanks to the Original poster of this tutorial, it helped me out greatly. I hope that my little addendum is of use to someone. apologies if it's messy / incomprehensible, but I'm typing this in a hurry. | |||
[[Category:PDA Examples]] |
Latest revision as of 08:09, 15 May 2008
You can compile a setup launcher which will install multiple CAB files to Windows Mobile-based Smartphone using the Nullsoft Scriptable Install System (NSIS).
Our objective is to make a desktop installer which will install several CAB files to a Smartphone by passing CAB files to the ActiveSync program.
Very Important Notice
It will facilitate understanding of this article if you already have a background knowledge on how INI files are written and how CAB files for Smartphone are created.
Requirements
1. NSIS version 2.09
2. This ZIP File NSIS.for.SP.zip (4 KB) - contains NSIS sample script, sample CAB, sample INI and other required files
3. Microsoft Active Sync program installed on your PC
Instructions
1. Download then install NSIS version 2.09. Once installed, it will create necessary registry changes on your PC so that all *.NSI files will be associated with Nullsoft Scriptable Install System.
2. Download then unzip contents of the ZIP file. You should have the following files:
3. Highlight ‘SCRIPT.nsi’ then right click mouse. Click on ‘Compile NSIS Script’.
4. Wait for the confirmation window.
5. Verify that your file was compiled.
6. Test your file.
The Options screen. You can choose from Custom or Full Installation type.
The Installation Directory dialog. This is where your files will be dumped.
Finally, once the last CAB file is being installed on the phone, you will see this on your computer’s monitor.
Tips
- Open the NSI file then make necessary changes (change app name, change icon, change component names etc)
- Provide your own CAB and INI files, provide a custom icon.
- Change content of the sample eula
- Open the html file then change the contents.
To add another CAB file (File 4, etc)
Code in green should be inserted between the 2 red lines. Before you recompile the script, ensure that you have the new files (4.CAB and 4.ini) inside the folder.
Try this sample setup launcher Multi.Cab.Install.zip (23 KB)
---ADDENDUM---
Cleaner Method.
While the above method works just fine, I would like to point out that the same result can be achieved without having the 'Add / Remove Programs' dialog pop up three times, which can be confusing and unfriendly to stupi...errr...Less Experienced users - it can be done much more cleanly in one dialog. This is also a better solution when you are installing dependencies (i.e: If you need to have the .Net compact framework installed before your main app).
To do this, take the above installscript, and modify it thusly:
StrCpy $0 "$INSTDIR\1.ini" ;Call InstallCAB <-- Comment out this line SectionEnd ; Section "File 2" SectionIn 1 SetOutPath "$INSTDIR" File 2.ini File 2.CAB StrCpy $2 "$INSTDIR\2.ini" ;<-- $2 instead of $0 ;Call InstallCAB <-- Comment out this line SectionEnd ; Section "File 3" SectionIn 1 SetOutPath "$INSTDIR" File 3.ini File 3.CAB StrCpy $3 "$INSTDIR\3.ini" ;<-- $3 instead of $0 Call InstallCAB <SNIP!> Function InstallCAB ExecWait '"$1" "$0" "$2" "$3"' ;<-- Extra parameters '$2' and '$3' Here FunctionEnd
What This Achieves:
The PDA CAB Files are installed by calling CEAppMgr.exe with the cab files as command-line parameters. In the main article, this is accomplished by calling CEAppMgr three times to install Three Cab Files. With my changes, instead of calling ceappmgr three times:
CeAppMgr 1.cab
CeAppMgr 2.cab
CeAppMgr 3.cab
it calls it once:
CeAppMgr 1.cab 2.cab 3.cab
CEAppMgr can handle multiple cab files in one go, thus is installs all three CAB files through one dialog.
If you want to change the order in which they get installed, i.e if 2.cab required that 3.cab was already installed, just change the order. e.g:
Function InstallCAB ExecWait '"$1" "$0" "$3" "$2"' FunctionEnd
Thanks to the Original poster of this tutorial, it helped me out greatly. I hope that my little addendum is of use to someone. apologies if it's messy / incomprehensible, but I'm typing this in a hurry.