; Script generated with the Venis Install Wizard ; Define your application name !define COMPNAME "MyComp" !define APPNAME "MyApp" !define APPNAMEANDVERSION "MyApp v1.2.1.3" #------------------------------------------------------------------ ; Use compression SetCompressor /FINAL /SOLID LZMA Icon "myapp.ico" ; Main Install settings Name "${APPNAMEANDVERSION}" InstallDir "$PROGRAMFILES\${COMPNAME}\${APPNAME}" InstallDirRegKey HKLM "Software\${APPNAME}" "" OutFile "MyApp01.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" !include "PPC-Registry.nsh" !include "LogicLib.nsh" ;!define MUI_FINISHPAGE_SHOWREADME "readme.txt" ;!define MUI_FINISHPAGE_LINK "MyApp for Pocket PC: http://www.myco.com" ;!define MUI_FINISHPAGE_LINK_LOCATION http://www.myco.com !define MUI_ABORTWARNING !insertmacro MUI_PAGE_WELCOME ; Page custom ReadmePage !insertmacro MUI_PAGE_LICENSE "licence.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_LANGUAGE "Danish" !insertmacro MUI_LANGUAGE "Dutch" !insertmacro MUI_LANGUAGE "French" !insertmacro MUI_LANGUAGE "German" !insertmacro MUI_LANGUAGE "Italian" !insertmacro MUI_LANGUAGE "Japanese" !insertmacro MUI_LANGUAGE "Russian" !insertmacro MUI_RESERVEFILE_LANGDLL ReserveFile "readme.txt" ReserveFile "licence.txt" ReserveFile "readme.ini" ;!insertmacro GetParent #------------------------------------------------------------------ Section "Search for value 'Content Value'" ; This Call opens the connection to the Pocket pc ; it returns 0 on success -1 on failure ${PPC-registry::CeRapiInit} $R0 ; This requires the LogicLib plugin included ; ${If} $R0 = '-1' MessageBox MB_OK 'Connection Failed' goto end ${ElseIf} $R0 = '0' MessageBox MB_OK 'Connection Success' goto keyexist ${Else} MessageBox MB_OK '$$R0 is "$R0"' ${EndIf} keyexist: !define PROCESSOR_ARCHITECTURE_INTEL 0 !define PROCESSOR_ARCHITECTURE_MIPS 1 !define PROCESSOR_ARCHITECTURE_SHX 4 !define PROCESSOR_ARCHITECTURE_ARM 5 System::Call "rapi::CeRapiInit() i .R0" System::Alloc 40 Pop $0 System::Call "CeGetSystemInfo(i r0)" System::Call "*$0(i, &i2 .r1)" System::Free $0 ${Switch} $1 ${Case} ${PROCESSOR_ARCHITECTURE_INTEL} DetailPrint "intel processor" ${Break} ${Case} ${PROCESSOR_ARCHITECTURE_ARM} DetailPrint "arm processor" ${Break} ${Case} ${PROCESSOR_ARCHITECTURE_SHX} DetailPrint "shx processor" ${Break} ${Case} ${PROCESSOR_ARCHITECTURE_MIPS} DetailPrint "mips processor" ${Break} ${Default} DetailPrint "unknown processor" ${Break} ${EndSwitch} end: ${PPC-registry::CeRapiUninit} ${PPC-registry::Unload} SectionEnd #------------------------------------------------------------------ Section "CEAppMgr" ; ; 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 WorkInTime" End: SectionEnd ; #------------------------------------------------------------------ ; extracts two cab files and ini into the instdir then calls function ; to install the cabs, installs NETCFv2 Section "netcf.all" Section1 SetOutPath "$INSTDIR" File "NETCFv2.ppc.armv4.ini" File "NETCFv2.ppc.armv4.cab" File "NETCFv2.wm.armv4i.ini" File "NETCFv2.wm.armv4i.cab" StrCpy $0 "$INSTDIR\NETCFv2.ppc.armv4.ini" StrCpy $0 "$INSTDIR\NETCFv2.wm.armv4i.ini" Call InstallCAB SectionEnd #------------------------------------------------------------------ Section "ARMV4" Section2 SetOverwrite on ; Set Section Files and Shortcuts SetOutPath "$INSTDIR" File "SpeedAlert_L_PPC.ARMV4.CAB" File "licence.txt" File "readme.txt" File "SpeedAlert_L_PPC.ARMV4.ini" StrCpy $0 "$INSTDIR\SpeedAlert_L_PPC.ARMV4.ini" Call InstallCAB SectionEnd #------------------------------------------------------------------ Section "SpeedAlert_L_PPC.MIPS" Section3 ; Set Section properties SetOverwrite on ; Set Section Files and Shortcuts SetOutPath "$INSTDIR" File "SpeedAlert_L_PPC.MIPS.CAB" File "SpeedAlert_L_PPC.MIPS.ini" StrCpy $0 "$INSTDIR\SpeedAlert_L_PPC.MIPS.ini" Call InstallCAB SectionEnd #------------------------------------------------------------------ Section "SpeedAlert_L_PPC.SH3" Section4 ; Set Section properties SetOverwrite on ; Set Section Files and Shortcuts SetOutPath "$INSTDIR" File "SpeedAlert_L_PPC.SH3.CAB" File "SpeedAlert_L_PPC.SH3.ini" StrCpy $0 "$INSTDIR\SpeedAlert_L_PPC.SH3.ini" Call InstallCAB SectionEnd #------------------------------------------------------------------ Function InstallCAB ExecWait '"$1" "$0"' FunctionEnd #------------------------------------------------------------------ ; On initialization Function .onInit !insertmacro MUI_INSTALLOPTIONS_EXTRACT "readme.ini" !insertmacro MUI_INSTALLOPTIONS_EXTRACT "readme.txt" !insertmacro MUI_LANGDLL_DISPLAY FunctionEnd #------------------------------------------------------------------ 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\MyComp\MyApp" "" "$INSTDIR" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SpeedAlert" "DisplayName" "SpeedAlert (remove only)" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SpeedAlert" "UninstallString" '"$INSTDIR\uninst.exe"' ; write out uninstaller WriteUninstaller "$INSTDIR\uninst.exe" SectionEnd ; end of -post section ShowInstDetails nevershow ;never show installation details ; begin uninstall settings/section UninstallText "This will uninstall SpeedAlert from your system" Section Uninstall ; add delete commands to delete whatever files/registry keys/etc you installed here. Delete "$INSTDIR\uninst.exe" DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Smart Car Technologies\SpeedAlert" DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SpeedAlert" RMDir "$INSTDIR" SectionEnd ; eof