LISTING 1 - EXAMPLE <APPLICATION_EXE>_SETUP.INI FILE

;-----------------------------------------------------------
; Template file for "ezsetup.exe" to create a proper setup for PPC targets.
; Sybase Pocket PowerBuilder IDE
;
; Strings:
; CAB_APPNAME     = Application Name
; CAB_FILE_EXE    = executable name (same for all targets)
; CAB_INSTALL_DIR = common files install directory
;
; CAB_PROVIDER    = provider name (like "mycompany")
; CAB_DESCRIPTION = product description
; CAB_COPYRIGHT   = product copyright
; CAB_PRODUCT     = product name
;-----------------------------------------------------------

[CEAppManager]
Version      = 1.0
Component    = PocketStopWatch


[PocketStopWatch]
Description  = PocketStopWatch
Uninstall    = PocketStopWatch
CabFiles     = **YOUR CAB FILES HERE***

; There may be multiple CAB files here both for the multiple CPU types
; and to include support like Pocket PowerBuilder and ASA support.
; So a possible entry would be:
; CabFiles = MyApp.ARM.CAB,MyApp.x86.CAB,PocketPowerBuilder.ARM.CAB,PocketPowerBuilder.x86.CAB,asa_ce.arm.30.cab,asa_ce.x86.30.cab
; Note - NO Spaces in the filenames or after the comma
;

LISTING 2 - SAMPLE

<APPLICATION_EXE>_MAKECAB.BAT FILE

"C:\Program Files\Sybase\PocketBuilder 2.0\support\cabwiz\CabwizSP.exe" "c:\documents and settings\bruce\my documents\my
 projects\pocketbuilder\pocketstopwatch\pocketstopwatch.inf" /err err.log /cpu ARM
REM
REM "C:\Program Files\Sybase\PocketBuilder 2.0\support\ezsetup\ezsetup.exe" -l english -i pocketstopwatch_setup.ini -r readme.txt -e
 eula.txt -o pocketstopwatch_setup.exe

LISTING 3 - SETUP_SP.INI FILE

[CEAppManager]
Version      = 1.0
Component    = PocketBuilder

[PocketBuilder]
Description  = PocketBuilder for SmartPhone
Uninstall    = PocketBuilder
CabFiles     = SP_PocketBuilder.ARM.CAB

LISTING 4 - SAMPLE NSI FILE

Name "PocketStopWatch"
Icon "PocketStopWatch.ico"
Uninstallicon "PocketStopWatch.ico"
OutFile "PocketStopWatch.Install.exe"
Installdir $PROGRAMFILES\TeamSybase\PocketStopWatch

LicenseText "Please read carefully. You must agree to this EULA before installing."
LicenseData "eula.txt"

DirText "Select the directory:"

InstType "FULL Installation"

ComponentText "This setup launcher will install the following file/s on your Smartphone" " " "Please choose file/s to install:"

Section "PocketStopWatch" ;
SectionIn 1
SetOutPath "$INSTDIR"

File eula.txt
File help.html

File pocketstopwatch_setup_sp.ini
File pocketstopwatch.ARM.CAB

; one-time initialization needed for InstallCAB subroutine
ReadRegStr $1 HKEY_LOCAL_MACHINE "software\Microsoft\Windows\CurrentVersion\App Paths\CEAppMgr.exe" ""
IfErrors Error
Goto End
Error:
MessageBox MB_OK|MB_ICONEXCLAMATION \
"Unable to find Application Manager for Smartphone applications. \
Please install ActiveSync Program and reinstall PocketStopWatch."
End:

StrCpy $0 "$INSTDIR\pocketstopwatch_setup.ini"
Call InstallCAB
SectionEnd ;

Section "PocketBuilder Runtime"
SectionIn 1
SetOutPath "$INSTDIR"

File pocketbuilder_setup_sp.ini
File SP_PocketBuilder.ARM.CAB

StrCpy $0 "$INSTDIR\pocketbuilder_setup_sp.ini"
Call InstallCAB

SectionEnd ;

Section "-post" ; (post install section, happens last after any optional sections) ;
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\TeamSybase\PocketStopWatch" "" "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\PocketStopWatch" "DisplayName" "PocketStopWatch
 (remove only)"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\PocketStopWatch" "UninstallString"
 '"$INSTDIR\uninst.exe"'

; write out uninstaller
WriteUninstaller "$INSTDIR\uninst.exe"

MessageBox MB_YESNO|MB_ICONQUESTION \
  "Thank you for installing PocketStopWatch. View HELP file now?" \
  IDNO NoReadme

  ExecShell open '$INSTDIR\help.html'

  NoReadme:

SectionEnd ;

ShowInstDetails nevershow ;

; begin uninstall settings/section
UninstallText "This will uninstall PocketStopWatch from your system"

Section Uninstall
Delete "$INSTDIR\uninst.exe"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\TeamSybase\PocketStopWatch"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PocketStopWatch"
RMDir "$INSTDIR"
SectionEnd ;

; Installs a Smartphone cab-application
; It expects $0 to contain the absolute location of the ini file
; to be installed.
Function InstallCAB

  ExecWait '"$1" "$0"'

FunctionEnd

; eof