|
|
@@ -97,6 +97,8 @@ Section "${SMDIRECTORY}" SecCore
|
|
|
File "${PANDA}\direct\__init__.py"
|
|
|
SetOutPath $INSTDIR\pandac
|
|
|
File /r "${PANDA}\pandac\*.py"
|
|
|
+ SetOutPath $INSTDIR\python
|
|
|
+ File /r "${PANDA}\python\*"
|
|
|
|
|
|
RMDir /r "$SMPROGRAMS\${SMDIRECTORY}"
|
|
|
CreateDirectory "$SMPROGRAMS\${SMDIRECTORY}"
|
|
|
@@ -107,10 +109,9 @@ Section "${SMDIRECTORY}" SecCore
|
|
|
File /r /x CVS "${PANDA}\models\audio\*"
|
|
|
SetOutPath $INSTDIR\bin
|
|
|
File /r "${PANDA}\bin\pzip.exe"
|
|
|
- File /r "${PANDA}\bin\ppython.exe"
|
|
|
SetOutpath $INSTDIR\game
|
|
|
File /r "${PPGAME}\*"
|
|
|
- CreateShortCut "$SMPROGRAMS\${SMDIRECTORY}\Play ${NAME}.lnk" "$INSTDIR\bin\ppython.exe" "${PPMAIN}" "$INSTDIR\${PPICON}" 0 SW_SHOWMINIMIZED "" "Play ${NAME}"
|
|
|
+ CreateShortCut "$SMPROGRAMS\${SMDIRECTORY}\Play ${NAME}.lnk" "$INSTDIR\python\ppython.exe" "${PPMAIN}" "$INSTDIR\${PPICON}" 0 SW_SHOWMINIMIZED "" "Play ${NAME}"
|
|
|
|
|
|
!else
|
|
|
|
|
|
@@ -136,7 +137,7 @@ Section "${SMDIRECTORY}" SecCore
|
|
|
SetOutPath $INSTDIR
|
|
|
File /r /x CVS "${PANDA}\ReleaseNotes"
|
|
|
!ifdef PYEXTRAS
|
|
|
- SetOutPath $INSTDIR\bin\lib
|
|
|
+ SetOutPath $INSTDIR\python\lib
|
|
|
File /nonfatal /r "${PYEXTRAS}\*"
|
|
|
!endif
|
|
|
SetOutPath $INSTDIR\models
|
|
|
@@ -148,10 +149,10 @@ Section "${SMDIRECTORY}" SecCore
|
|
|
WriteINIStr $INSTDIR\Website.url "InternetShortcut" "URL" "http://panda3d.etc.cmu.edu/"
|
|
|
WriteINIStr $INSTDIR\Manual.url "InternetShortcut" "URL" "http://panda3d.etc.cmu.edu/wiki/index.php"
|
|
|
SetOutPath $INSTDIR\samples\GreetingCard
|
|
|
- CreateShortCut "$SMPROGRAMS\${SMDIRECTORY}\Panda Greeting Card.lnk" "$INSTDIR\bin\ppython.exe" 'GreetingCard.py "$SMPROGRAMS\${SMDIRECTORY}"' "$INSTDIR\bin\pzip.exe" 0 SW_SHOWMINIMIZED "" "Panda Greeting Card"
|
|
|
+ CreateShortCut "$SMPROGRAMS\${SMDIRECTORY}\Panda Greeting Card.lnk" "$INSTDIR\python\ppython.exe" 'GreetingCard.py "$SMPROGRAMS\${SMDIRECTORY}"' "$INSTDIR\bin\pzip.exe" 0 SW_SHOWMINIMIZED "" "Panda Greeting Card"
|
|
|
SetOutPath $INSTDIR
|
|
|
- CreateShortCut "$SMPROGRAMS\${SMDIRECTORY}\Panda Manual.lnk" "$INSTDIR\Manual.url" "" "$INSTDIR\bin\ppython.exe" 0 "" "" "Panda Manual"
|
|
|
- CreateShortCut "$SMPROGRAMS\${SMDIRECTORY}\Panda Website.lnk" "$INSTDIR\Website.url" "" "$INSTDIR\bin\ppython.exe" 0 "" "" "Panda Website"
|
|
|
+ CreateShortCut "$SMPROGRAMS\${SMDIRECTORY}\Panda Manual.lnk" "$INSTDIR\Manual.url" "" "$INSTDIR\python\ppython.exe" 0 "" "" "Panda Manual"
|
|
|
+ CreateShortCut "$SMPROGRAMS\${SMDIRECTORY}\Panda Website.lnk" "$INSTDIR\Website.url" "" "$INSTDIR\python\ppython.exe" 0 "" "" "Panda Website"
|
|
|
|
|
|
FindFirst $0 $1 $INSTDIR\samples\*--*
|
|
|
loop:
|
|
|
@@ -179,8 +180,8 @@ Section "${SMDIRECTORY}" SecCore
|
|
|
Call StrRep
|
|
|
Pop $R0
|
|
|
StrCpy $TUTNAME $R0
|
|
|
- CreateShortCut "$SMPROGRAMS\${SMDIRECTORY}\$READABLE\Run $TUTNAME.lnk" "$INSTDIR\bin\ppython.exe" "$3" "$INSTDIR\bin\pzip.exe" 0 SW_SHOWMINIMIZED "" "Run $TUTNAME"
|
|
|
- CreateShortCut "$INSTDIR\samples\$1\Run $TUTNAME.lnk" "$INSTDIR\bin\ppython.exe" "$3" "$INSTDIR\bin\pzip.exe" 0 SW_SHOWMINIMIZED "" "Run $TUTNAME"
|
|
|
+ CreateShortCut "$SMPROGRAMS\${SMDIRECTORY}\$READABLE\Run $TUTNAME.lnk" "$INSTDIR\python\ppython.exe" "$3" "$INSTDIR\bin\pzip.exe" 0 SW_SHOWMINIMIZED "" "Run $TUTNAME"
|
|
|
+ CreateShortCut "$INSTDIR\samples\$1\Run $TUTNAME.lnk" "$INSTDIR\python\ppython.exe" "$3" "$INSTDIR\bin\pzip.exe" 0 SW_SHOWMINIMIZED "" "Run $TUTNAME"
|
|
|
FindNext $2 $3
|
|
|
goto iloop
|
|
|
idone:
|
|
|
@@ -199,15 +200,31 @@ Section -post
|
|
|
|
|
|
!ifndef PPGAME
|
|
|
# Add the "bin" directory to the PATH.
|
|
|
+ Push "$INSTDIR\python"
|
|
|
+ Call RemoveFromPath
|
|
|
+ Push "$INSTDIR\bin"
|
|
|
+ Call RemoveFromPath
|
|
|
+ Push "$INSTDIR\python"
|
|
|
+ Call AddToPath
|
|
|
Push "$INSTDIR\bin"
|
|
|
Call AddToPath
|
|
|
- !endif
|
|
|
|
|
|
- DetailPrint "Registering Helix Preferences..."
|
|
|
- WriteRegStr HKLM "Software\Helix\HelixSDK\10.0\Preferences\UseOverlay" "" "0"
|
|
|
- WriteRegStr HKLM "Software\Helix\HelixSDK\10.0\Preferences\UseWinDraw" "" "0"
|
|
|
- WriteRegStr HKCU "Software\Helix\HelixSDK\10.0\Preferences\UseOverlay" "" "0"
|
|
|
- WriteRegStr HKCU "Software\Helix\HelixSDK\10.0\Preferences\UseWinDraw" "" "0"
|
|
|
+ ReadRegStr $0 HKLM "Software\Python\PythonCore\2.4\InstallPath" ""
|
|
|
+ StrCmp $0 "$INSTDIR\python" RegPath 0
|
|
|
+ StrCmp $0 "" RegPath 0
|
|
|
+
|
|
|
+ MessageBox MB_YESNO|MB_ICONQUESTION \
|
|
|
+ "Python add-on installers use a registry key to locate the Python directory. The registry key is already pointing to a copy of Python. Do you want to change the registry key to point to Panda's copy?" \
|
|
|
+ IDNO SkipRegPath
|
|
|
+
|
|
|
+ RegPath:
|
|
|
+ DetailPrint "Adding registry keys for python..."
|
|
|
+ WriteRegStr HKLM "Software\Python\PythonCore\2.4\InstallPath" "" "$INSTDIR\python"
|
|
|
+ WriteRegStr HKLM "Software\Python\PythonCore\2.4\Help" "" ""
|
|
|
+ WriteRegStr HKLM "Software\Python\PythonCore\2.4\Help\Main Python Documentation" "" "$INSTDIR\python\Doc\Python24.chm"
|
|
|
+ WriteRegStr HKLM "Software\Python\PythonCore\2.4\Help\Pythonwin Reference" "" "$INSTDIR\python\Lib\site-packages\PyWin32.chm"
|
|
|
+ SkipRegPath:
|
|
|
+ !endif
|
|
|
|
|
|
DetailPrint "Adding the uninstaller ..."
|
|
|
Delete "$INSTDIR\uninst.exe"
|
|
|
@@ -221,8 +238,19 @@ SectionEnd
|
|
|
Section Uninstall
|
|
|
|
|
|
!ifndef PPGAME
|
|
|
+ Push "$INSTDIR\python"
|
|
|
+ Call un.RemoveFromPath
|
|
|
+ Push "$INSTDIR\python"
|
|
|
+ Call un.RemoveFromPath
|
|
|
+ Push "$INSTDIR\bin"
|
|
|
+ Call un.RemoveFromPath
|
|
|
Push "$INSTDIR\bin"
|
|
|
Call un.RemoveFromPath
|
|
|
+
|
|
|
+ ReadRegStr $0 HKLM "Software\Python\PythonCore\2.4\InstallPath" ""
|
|
|
+ StrCmp $0 "$INSTDIR\python" 0 SkipUnReg
|
|
|
+ DeleteRegKey HKLM "Software\Python\PythonCore\2.4"
|
|
|
+ SkipUnReg:
|
|
|
!endif
|
|
|
|
|
|
Delete "$INSTDIR\uninst.exe"
|
|
|
@@ -264,6 +292,40 @@ Function un.IsNT
|
|
|
Push 1
|
|
|
FunctionEnd
|
|
|
|
|
|
+; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
|
|
|
+Function StrStr
|
|
|
+ Push $0
|
|
|
+ Exch
|
|
|
+ Pop $0 ; $0 now have the string to find
|
|
|
+ Push $1
|
|
|
+ Exch 2
|
|
|
+ Pop $1 ; $1 now have the string to find in
|
|
|
+ Exch
|
|
|
+ Push $2
|
|
|
+ Push $3
|
|
|
+ Push $4
|
|
|
+ Push $5
|
|
|
+ StrCpy $2 -1
|
|
|
+ StrLen $3 $0
|
|
|
+ StrLen $4 $1
|
|
|
+ IntOp $4 $4 - $3
|
|
|
+ unStrStr_loop:
|
|
|
+ IntOp $2 $2 + 1
|
|
|
+ IntCmp $2 $4 0 0 unStrStrReturn_notFound
|
|
|
+ StrCpy $5 $1 $3 $2
|
|
|
+ StrCmp $5 $0 unStrStr_done unStrStr_loop
|
|
|
+ unStrStrReturn_notFound:
|
|
|
+ StrCpy $2 -1
|
|
|
+ unStrStr_done:
|
|
|
+ Pop $5
|
|
|
+ Pop $4
|
|
|
+ Pop $3
|
|
|
+ Exch $2
|
|
|
+ Exch 2
|
|
|
+ Pop $0
|
|
|
+ Pop $1
|
|
|
+FunctionEnd
|
|
|
+
|
|
|
; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
|
|
|
Function un.StrStr
|
|
|
Push $0
|
|
|
@@ -358,6 +420,94 @@ Function AddToPath
|
|
|
Pop $0
|
|
|
FunctionEnd
|
|
|
|
|
|
+; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
|
|
|
+Function RemoveFromPath
|
|
|
+ Exch $0
|
|
|
+ Push $1
|
|
|
+ Push $2
|
|
|
+ Push $3
|
|
|
+ Push $4
|
|
|
+ Push $5
|
|
|
+ Call IsNT
|
|
|
+ Pop $1
|
|
|
+ StrCmp $1 1 unRemoveFromPath_NT
|
|
|
+ ; Not on NT
|
|
|
+ StrCpy $1 $WINDIR 2
|
|
|
+ FileOpen $1 "$1\autoexec.bat" r
|
|
|
+ GetTempFileName $4
|
|
|
+ FileOpen $2 $4 w
|
|
|
+ GetFullPathName /SHORT $0 $0
|
|
|
+ StrCpy $0 "SET PATH=%PATH%;$0"
|
|
|
+ SetRebootFlag true
|
|
|
+ Goto unRemoveFromPath_dosLoop
|
|
|
+
|
|
|
+ unRemoveFromPath_dosLoop:
|
|
|
+ FileRead $1 $3
|
|
|
+ StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoop
|
|
|
+ StrCmp $3 "$0$\n" unRemoveFromPath_dosLoop
|
|
|
+ StrCmp $3 "$0" unRemoveFromPath_dosLoop
|
|
|
+ StrCmp $3 "" unRemoveFromPath_dosLoopEnd
|
|
|
+ FileWrite $2 $3
|
|
|
+ Goto unRemoveFromPath_dosLoop
|
|
|
+
|
|
|
+ unRemoveFromPath_dosLoopEnd:
|
|
|
+ FileClose $2
|
|
|
+ FileClose $1
|
|
|
+ StrCpy $1 $WINDIR 2
|
|
|
+ Delete "$1\autoexec.bat"
|
|
|
+ CopyFiles /SILENT $4 "$1\autoexec.bat"
|
|
|
+ Delete $4
|
|
|
+ Goto unRemoveFromPath_done
|
|
|
+
|
|
|
+ unRemoveFromPath_NT:
|
|
|
+ StrLen $2 $0
|
|
|
+ Call IsUserAdmin
|
|
|
+ Pop $5
|
|
|
+ StrCmp $5 1 0 NotAdmin
|
|
|
+ ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
|
|
|
+ Push $1
|
|
|
+ Push $0
|
|
|
+ Call StrStr ; Find $0 in $1
|
|
|
+ Pop $0 ; pos of our dir
|
|
|
+ IntCmp $0 -1 unRemoveFromPath_done
|
|
|
+ ; else, it is in path
|
|
|
+ StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir
|
|
|
+ IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';')
|
|
|
+ IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon.
|
|
|
+ StrLen $0 $1
|
|
|
+ StrCpy $1 $1 $0 $2
|
|
|
+ StrCpy $3 "$3$1"
|
|
|
+ WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3
|
|
|
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
|
|
|
+ Goto unRemoveFromPath_done
|
|
|
+
|
|
|
+
|
|
|
+ NotAdmin:
|
|
|
+ ReadRegStr $1 HKCU "Environment" "PATH"
|
|
|
+ Push $1
|
|
|
+ Push $0
|
|
|
+ Call StrStr ; Find $0 in $1
|
|
|
+ Pop $0 ; pos of our dir
|
|
|
+ IntCmp $0 -1 unRemoveFromPath_done
|
|
|
+ ; else, it is in path
|
|
|
+ StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir
|
|
|
+ IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';')
|
|
|
+ IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon.
|
|
|
+ StrLen $0 $1
|
|
|
+ StrCpy $1 $1 $0 $2
|
|
|
+ StrCpy $3 "$3$1"
|
|
|
+ WriteRegExpandStr HKCU "Environment" "PATH" $3
|
|
|
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
|
|
|
+
|
|
|
+ unRemoveFromPath_done:
|
|
|
+ Pop $5
|
|
|
+ Pop $4
|
|
|
+ Pop $3
|
|
|
+ Pop $2
|
|
|
+ Pop $1
|
|
|
+ Pop $0
|
|
|
+FunctionEnd
|
|
|
+
|
|
|
; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
|
|
|
Function un.RemoveFromPath
|
|
|
Exch $0
|