Possible packpanda issue (Windows)

I know packpanda 1.5.3 had something wrong in its code, but as far as I know, 1.5.2 is supposed to work. So I called the binary and the problem is that, although packpanda is getting fine the path to call makensis, the correct ‘long’ path doesn’t work. It seems like it doesn’t accept folder names with spaces or greater than 8 chars. I changed the pandapath variable to DOS names (I mean 6 chars + alt 126 char + number) but packpanda keeps calling makensis with the ‘long’ path.

My solution was installing panda in a folder with a name short enough to avoid any trouble. This time 1.5.4. It worked but I don’t know if it was due to new version or because of the folder name change.

Maybe it’s just something wrong with me, but I wanted to post this, just in case this issue can be reproduced and sneaked its way into 1.5.4.

Hmm, the only changes to packpanda between 1.5.3 and 1.5.4 were a couple of fixed bugs. Nothing changed at all related to your issue between 1.5.2. and 1.5.4.

Is this issue occurring in all versions you’ve tested so far? If so, it’s most likely a bug.

This issue has happened to me just in 1.5.2, I’ve not seen it in 1.5.4 but I’m making a test in my laptop with 1.5.4, so I’m posting my findings soon.

[EDIT] Bad news. I’ve just reproduced the issue with 1.5.4 in Vista. I’ve got some output:

C:\>packpanda --dir test --name "my test project"
PANDA located at C:\Program Files\Panda3D-1.5.4
Dir            : C:\test
Name           : my test project
Start Menu     : my test project
Main           : C:\test\main.py
Icon           : C:\test\icon.ico (MISSING)
Bitmap         : C:\test\installer.bmp (MISSING)
License        : C:\test\license.txt (MISSING)
Output         : C:\test.exe
Install Dir    : C:\test

Copying the game to C:\packpanda-TMP...

Compiling BAM and PYC files...
Compiling python .\main.py
Executing: egg2bam -noabs -ps rel -pd . ".\plane.egg.pz" -o ".\plane.bam"

Writing ./plane.bam
Executing: egg2bam -noabs -ps rel -pd . ".\PR_pencil.egg" -o ".\PR_pencil.bam"

Writing ./PR_pencil.bam

C:\Program Files\Panda3D-1.5.4\nsis\makensis.exe /V2 /DCOMPRESSOR="lzma" /DNAME=
"my test project" /DSMDIRECTORY="my test project" /DINSTALLDIR="C:\test" /DOUTFI
LE="C:\test.exe" /DLICENSE="C:\Program Files\Panda3D-1.5.4\LICENSE" /DLANGUAGE="
English" /DRUNTEXT="Play my test project" /DIBITMAP="C:\Program Files\Panda3D-1.
5.4\nsis\Contrib\Graphics\Wizard\nsis.bmp" /DUBITMAP="C:\Program Files\Panda3D-1
.5.4\nsis\Contrib\Graphics\Wizard\nsis.bmp" /DPANDA="C:\Program Files\Panda3D-1.
5.4" /DPANDACONF="C:\packpanda-TMP\etc" /DPSOURCE="C:\Program Files\Panda3D-1.5.
4" /DPPGAME="C:\packpanda-TMP\game" /DPPMAIN="main.py" /DPPICON="bin\ppython.exe
" "C:\Program Files\Panda3D-1.5.4\direct\src\directscripts\packpanda.nsi"
packing...
"C:\Program" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

C:\>

The error text into English would be something like “C:\Program” is not recognized as an internal or external command, program or executable batch file.

BTW: I’m having a look at packpanda.py, maybe even I get a fix

[EDIT] Here’s my fix:
In packpanda last line:

os.system(CMD)

I think it would work:

if os.name=="nt":
    os.system('"'+CMD+'"')
else:
    os.system(CMD)

This way Unix or other platforms get untouched and in windows the call gets double quoted, so normal and long names calls run without problem (my tests point this way)

Don’t worry, packpanda works just on windows yet. :slight_smile:

Your fix breaks the command, however. I’ve checked in a fix that should fix it, although I’m not sure. Could you grab this version of packpanda.py and try again:
panda3d.cvs.sourceforge.net/view … ision=1.17
(sorry. phpBB messes up the url, so you will need to copy and paste it.)

Wow, I’m sorry about my ‘fix’ :blush: I focused in the call and didn’t checked the options working, probably you took more time with my ‘help’ than you had taken on your own. Anyway, I tested the new packpanda source and it doesn’t seem to work yet.

I understand the change, you quote the makensis command and the options stay the same. Unfortunately windows is stupid enough to complain about this too.

C:\Archivos de programa\Adobe>ppython packpanda_n.py --dir "c:\archivos de progr
ama\aaaatest" --name my_test
PANDA located at C:\P3D_154
Dir            : c:\archivos de programa\aaaatest
Name           : my_test
Start Menu     : my_test
Main           : c:\archivos de programa\aaaatest\main.py
Icon           : c:\archivos de programa\aaaatest\icon.ico (MISSING)
Bitmap         : c:\archivos de programa\aaaatest\installer.bmp (MISSING)
License        : c:\archivos de programa\aaaatest\license.txt (MISSING)
Output         : C:\Archivos de programa\Adobe\aaaatest.exe
Install Dir    : C:\aaaatest

Copying the game to C:\Archivos de programa\Adobe\packpanda-TMP...

Compiling BAM and PYC files...
Compiling python .\main.py
Executing: egg2bam -noabs -ps rel -pd . ".\plane.egg.pz" -o ".\plane.bam"

Writing ./plane.bam

"C:\P3D_154\nsis\makensis.exe" /V2 /DCOMPRESSOR="lzma" /DNAME="my_test" /DSMDIRE
CTORY="my_test" /DINSTALLDIR="C:\aaaatest" /DOUTFILE="C:\Archivos de programa\Ad
obe\aaaatest.exe" /DLICENSE="C:\P3D_154\LICENSE" /DLANGUAGE="English" /DRUNTEXT=
"Play my_test" /DIBITMAP="C:\P3D_154\nsis\Contrib\Graphics\Wizard\nsis.bmp" /DUB
ITMAP="C:\P3D_154\nsis\Contrib\Graphics\Wizard\nsis.bmp" /DPANDA="C:\P3D_154" /D
PANDACONF="C:\Archivos de programa\Adobe\packpanda-TMP\etc" /DPSOURCE="C:\P3D_15
4" /DPPGAME="C:\Archivos de programa\Adobe\packpanda-TMP\game" /DPPMAIN="main.py
" /DPPICON="bin\ppython.exe" "C:\P3D_154\direct\src\directscripts\packpanda.nsi"

packing...
El nombre de archivo, directorio o etiqueta del volumen no es válido.

I’m testing new things looking for a solution that actually helps this time.

[EDIT] Latest report- It’s weird, you can make a call in windows this way:
“quoted-abs-path-plus-filename” “par1 par2 par3” but if that very same call is made inside an os.sys() it doesn’t work. Working on some workaround

os.system seems just too stupid on windows. I’ll create a better solution for this as soon as I’m on windows, possibly using subprocess or so. (remind me if I still haven’t replied in a few weeks)

You are right, it’s pretty simple with subprocess

##import sys, os, getopt, string, shutil, py_compile
##->
import sys, os, getopt, string, shutil, py_compile, subprocess
## os.system(CMD)
##->
subprocess.call(CMD,shell=False)

It worked for me

Sorry for my late reply.
I’ve just checked in some changes to packpanda.py, could you maybe test if this fixes it?

Done! It works just fine. And it seems you’ve added linux support too. Cool!