Hi there,
I've build a demo app that supports Pocket PC 2003, Pocket PC 2003 SE and Windows Mobile 5. With NSIS i've created an MSI installer that works fine for installing the Compact Framework 2.0 and the application's Cab file on my Device through ActiveSync, but does not install automatically SQL Server Mobile Edition 2005.
I've included the following cab files.
sqlce30.ppc.wce4.armv4.cab (for Pocket PC 2003 and SE)
sqlce30.ppc.wce5.armv4i.cab (for Windows Mobile 5)
However the SQLCE3.0 cab will will install when you manually copy it to your device and run it from the Device. The installer is used for deployment, so i don't want to deploy it from within Visual Studio .NET 2005 (Then Visual Studio 2005 does install SQL Server 2005 Mobile Edition through ActiveSync).
I want to make the installer available to clients and then automatically install in the following order CF 2.0, SQLCE3.0 (2005 Mobile edition) and the application.
Below is my NSIS script
Can somebody help me
Thanks in advance
Robbert
p.s. Feel free to use the NSIS script below.
_________________________________________________
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Your Product"
!define PRODUCT_VERSION "1.0"
!define PRODUCT_PUBLISHER "Your Name"
!define PRODUCT_WEB_SITE "http://www.Your Name.com"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "app.ico"
!define MUI_UNICON "app.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "eula.txt"
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Your Product Setup.exe"
InstallDir "$PROGRAMFILES\Your Name\Your Product"
ShowInstDetails show
ShowUnInstDetails show
;-------------------------------
; Call Pocket PC ActiveSync App
;-------------------------------
Section
;locate and launch the CEAPPMGR for the Pocket PC
Call InitInstallCAB
SectionEnd
Section "Compact Framework 2.0" SEC01
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
File "netcf.ini"
File "NETCFv2.ppc.armv4.cab"
File "NETCFv2.wm.armv4i.cab"
StrCpy $0 "$INSTDIR\netcf.ini"
Call InstallCAB
MessageBox MB_OK|MB_ICONEXCLAMATION \
"Please wait for the Compact Framework 2.0 install to finish on your device before continuing."
SectionEnd
Section "SQL Server CE 3.0" SEC02
File "sqlce.ini"
File "sqlce30.ppc.wce4.armv4.cab"
File "sqlce30.ppc.wce5.armv4i.cab"
StrCpy $0 "$INSTDIR\sqlce.ini"
Call InstallCAB
MessageBox MB_OK|MB_ICONEXCLAMATION \
"Please wait for SQL Server CE 3.0 (SQL Server Mobile Edition) install to finish on your device before continuing."
SectionEnd
Section "Your Product" SEC03
File "yourproduct.ini"
File "yourproduct.Setup.CAB"
StrCpy $0 "$INSTDIR\yourproduct.ini"
Call InstallCAB
MessageBox MB_OK|MB_ICONEXCLAMATION \
"Please wait for Your Product install to finish on your device before continuing."
SectionEnd
Section -AdditionalIcons
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateDirectory "$SMPROGRAMS\Your Product"
CreateShortCut "$SMPROGRAMS\Your Product\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
CreateShortCut "$SMPROGRAMS\Your Product\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "This installs the Compact Framework 2.0 (required for the application to run)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "This installs SQL Server CE 3.0 (SQL Server Mobile Edition) (required for the application to run)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "This installs the actual Your Product application (required to run the application)"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "Your Product was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove Your Product and all of its components " IDYES +2
Abort
FunctionEnd
Section Uninstall
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\yourproduct.Setup.CAB"
Delete "$INSTDIR\sqlce30.ppc.wce5.armv4i.CAB"
Delete "$INSTDIR\sqlce30.ppc.wce4.armv4.CAB"
Delete "$INSTDIR\NETCFv2.ppc.armv4.cab"
Delete "$INSTDIR\NETCFv2.wm.armv4i.cab"
Delete "$INSTDIR\netcf.ini"
Delete "$INSTDIR\sqlce.ini"
Delete "$INSTDIR\yourproduct.ini"
Delete "$SMPROGRAMS\Your Product\Uninstall.lnk"
Delete "$SMPROGRAMS\Your Product\Website.lnk"
RMDir "$SMPROGRAMS\Your Product"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
SetAutoClose true
SectionEnd
;--------------------------------
; Pocket PC Install Section
;--------------------------------
; Installs a PocketPC cab-application
; It expects $0 to contain the absolute location of the ini file to be installed.
Function InstallCAB
ExecWait '"$1" "$0"'
FunctionEnd
;--------------------------------
; OPEN CEAPPMGR FOR POCKET PC APPLICATION INSTALLING
;--------------------------------
Function InitInstallCAB
; 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 PocketPC applications. \
Please install ActiveSync and reinstall YourApp."
End:
FunctionEnd

NSIS Setup installer does not install SQL CE 3.0 but does install CF2.0 and Application cab files
Ethangar
This is the sqlce.ini file. It also doesn't work if i include all the sqlce30 files for both the platforms:
[CEAppManager]
Version = 1.0
Component = SQLCE
[SQLCE]
Description = SQLCE
Uninstall = SQLCE
CabFiles = sqlce30.ppc.wce4.armv4.cab, sqlce30.wce5.armv4i.cab,sqlce30.repl.wce5.armv4i.cab,sqlce30.repl.ppc.wce5.armv4i.cab,sqlce30.repl.phone.wce5.armv4i.cab,sqlce30.ppc.wce5.armv4i.cab,sqlce30.phone.wce5.armv4i.cab,sqlce30.dev.ENU.wce5.armv4i.cab,sqlce30.dev.ENU.ppc.wce5.armv4i.cab,sqlce30.dev.ENU.phone.wce5.armv4i.cab
yjtsai
Hi there,
I've found the solution myself in the following article:
http://support.microsoft.com/default.aspx scid=kb;en-us;181007
Verify in the INF file that string lists do not have trailing commas or unnecessary/extra spaces.