Archive: Working on my first script for Pocket PC - Need some help


Working on my first script for Pocket PC - Need some help
Hi

I have read through the forums and have used an example off of here to create an install for my application. However it is not working quite right.

It displays the readme.txt and eula.txt fine and connects to my Pocket PC fine but the installation screen for the Pocket PC has a bunch of files listed there to select for install/remove (why I don't know) but none are the files contained in my script. It appears that my cabs and .mdb file are being ignored even though they are in the same folder as the readme.txt and eula.txt.

Can some someone figure this out for me and point me in the right direction. I am new to this so simple explainations work best for my simple mind.

I have pasted my ini file then my installer script.

Thanks

L

*********************
setup.ini start
*********************

[CEAppManager]
Version = 1.0
Component = App

[App]
Description = Pocket PCT.
CabFiles = pct_PPC.ARM.CAB,pct_PPC.ARMV4.CAB,pct_PPC.MIPS.CAB,pct_PPC.WCE420X86.CAB,pct_PPC.X86.CAB


*********************
setup.nsi start
*********************
; Script generated with the Venis Install Wizard

; Define your application name
!define APPNAME "Pocket PCT"
!define APPNAMEANDVERSION "Pocket PCT v1.1"

; Use compression
SetCompressor /FINAL /SOLID LZMA

Icon "G:\Visual Studio Projects\Projects\pct.ico"


; Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDir "$PROGRAMFILES\Pocket PCT"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "pocketpct.exe"

!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"

; Modern interface settings
!include "MUI.nsh"
!include "FileFunc.nsh"

;!define MUI_FINISHPAGE_SHOWREADME "readme.txt"
;!define MUI_FINISHPAGE_LINK "Pocket PCT: http://www.pct.com"
;!define MUI_FINISHPAGE_LINK_LOCATION http://www.pct.com

!define MUI_ABORTWARNING

!insertmacro MUI_PAGE_WELCOME
Page custom ReadmePage
!insertmacro MUI_PAGE_LICENSE "eula.txt"
;!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

; Set languages (first is default language)
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL

ReserveFile "readme.txt"
ReserveFile "eula.txt"
ReserveFile "readme.ini"

!insertmacro GetParent

Section "PCT" Section1

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 an Application Manager for PocketPC applications. \
Please install Microsoft ActiveSync and reinstall the software."
Abort
End:

${GetParent} "$1" $2
; Set Section properties
SetOverwrite on

; Set Section Files and Shortcuts
SetOutPath "$2\Pocket PCT"
File "pct_PPC.ARM.CAB"
File "pct_PPC.ARMV4.CAB"
File "pct_PPC.MIPS.CAB"
File "pct_PPC.SH3.CAB"
File "pct_PPC.WCE420X86.CAB"
File "pct_PPC.X86.CAB"
File "pct.mdb"
File "eula.txt"
File "readme.txt"
File "setup.ini"

StrCpy $0 "$2\setup.ini"
Call InstallCAB
SectionEnd

Var HWND
Var DLGITEM

Function ReadmePage

InitPluginsDir
SetOutPath "$PLUGINSDIR"
File "readme.txt"

!insertmacro MUI_HEADER_TEXT "Release notes" "Pleas read"
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "readme.ini"
Pop $HWND ;HWND of dialog
GetDlgItem $DLGITEM $HWND 1200 ;1200 + Field number - 1

;$DLGITEM contains the HWND of the first field
SetCtlColors $DLGITEM "" "${MUI_BGCOLOR}"

; clear the field
SendMessage $DLGITEM ${WM_SETTEXT} 1 "STR: "

FileOpen $1 "$PLUGINSDIR\readme.txt" "r"
loop:
FileRead $1 $2
SendMessage $DLGITEM 0x00C2 0 "STR:$2"
IfErrors 0 loop
FileClose $1
SendMessage $DLGITEM 0x00B1 0 0 ; EM_SETSEL
SendMessage $DLGITEM 0x00B7 0 0 ; EM_SCROLLCARET

!insertmacro MUI_INSTALLOPTIONS_SHOW

FunctionEnd

Function InstallCAB

ExecWait '"$1" "$0"'

FunctionEnd

; Modern install component descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} ""
!insertmacro MUI_FUNCTION_DESCRIPTION_END


; On initialization
Function .onInit

!insertmacro MUI_INSTALLOPTIONS_EXTRACT "readme.ini"
!insertmacro MUI_LANGDLL_DISPLAY

FunctionEnd

; eof

CEAppMgr might be looking for the files in the directory that contains setup.ini because you haven't supplied full paths in the setup.ini. Try extracting setup.ini to the same directory as the CABs.

Please attach scripts next time.


also


SetOutPath "$2\Pocket PCT"

StrCpy $0 "$2\setup.ini"

wouldn't it need to be

StrCpy $0 "$2\Pocket PCT\setup.ini"