Problem using NSIS for Pocket PC
Hi,
I try to make an installer, using NSIS, for Pocket PC. I need to install 2 cabs on PPC. When installing the second cab the installer delete the files that was installed from the first cab!
I'll copy the nsi and ini code here.
nsi file:
Name "veniceXplorer"
Icon "veniceXplorer.ico"
OutFile "veniceXplorer.exe"
LicenseText "You must agree to this license before installing."
LicenseData "eula.txt"
InstallDir "$PROGRAMFILES\veniceXplorer"
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\hot dot\veniceXplorer" ""
DirText "Select the directory to install veniceXplorer in:"
Section "veniceXplorer"
SetOutPath "$INSTDIR"
File eula.txt
File readme.html
File mappe.ini
File mappe.CAB
File veniceXplorer.ini
File veniceXplorer.CAB
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:
StrCpy $3 "$INSTDIR\mappe.ini"
StrCpy $2 "$INSTDIR\veniceXplorer.ini"
Call InstallCAB
SectionEnd
Section "-post" ; (post install section, happens last after any optional sections) ; add any commands that need to happen after any optional sections here
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\hot dot\veniceXplorer" "" "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\veniceXplorer" "DisplayName" "veniceXplorer (remove only)"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\veniceXplorer" "UninstallString" '"$INSTDIR\uninst.exe"'
WriteUninstaller "$INSTDIR\uninst.exe"
MessageBox MB_YESNO|MB_ICONQUESTION \
"Setup has completed. View readme file now?" \
IDNO NoReadme
ExecShell open '$INSTDIR\readme.html'
NoReadme:
Quit
SectionEnd
ShowInstDetails nevershow ;never show installation details
UninstallText "This will uninstall YourApp from your system"
Section Uninstall
Delete "$INSTDIR\uninst.exe"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\hot dot\veniceXplorer"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\veniceXplorer"
RMDir "$INSTDIR"
SectionEnd ; end of uninstall section
Function InstallCAB
ExecWait '"$1" "$2" "$3"'
FunctionEnd
mappe.ini:
[CEAppManager]
Version = 1.0
Component = PocketPlus
[PocketPlus]
Description = Pocket Plus
Uninstall = PocketPlus
CabFiles = mappe.cab
veniceXplorer.ini:
[CEAppManager]
Version = 1.0
Component = PocketPlus
[PocketPlus]
Description = Pocket Plus
Uninstall = PocketPlus
CabFiles = veniceXplorer.cab
That's all.
Thanks for your time!