Posted by Utopian in SWF Studio V3 on May 12 2008, 04:36 pm

I've wrapped foo.swf up foo.exe by using the trial version of SWF Studio 3.5. I'm using Windows XP. If I invoke foo.exe by double-clicking it, it runs fine. If I invoke it from a batch file, however, it may or may not launch, depending on how the batch file is written. Here are the batch files:

good.bat:
cd flash
foo.exe
pause

bad.bat:
flash\foo.exe
pause

The "good.bat" file works fine, the "bad.bat" file does not. My conclusion, which seems crazy, is that foo.exe will not function, unless it is invoked from the directory which contains foo.exe.

My first concern is that the failure is silent ... there is no error message ... foo.exe simply exits.

My other concern is that I don't really use batch files, I launch from a different .exe, which can't live in my "flash" folder.

Am I correct in my analysis here? Is there anyway to get foo.exe to work, with a different working directory?

The attached .zip file has all the code to reproduce this problem.

attachments: foo.zip  


Posted by northcode in SWF Studio V3 on May 12 2008, 06:26 pm

This is a known issue, we're looking into it, but if you're launching your EXE from another EXE you can set the "current directory" in the call to Shell.execute - that will get around the issue you're seeing. Just set the current directory argument to the same folder as the EXE and it will work.


Posted by Utopian in SWF Studio V3 on May 12 2008, 08:47 pm

Tom, thanks for the prompt response, and for validating that this is a real issue.

The Projector .exe is invoked from a different program in a different language. I can't figure out how to make the other language set the working directory.


Posted by northcode in SWF Studio V3 on May 13 2008, 10:06 am

What language is the other app written in and can you show me the call you're using? We speak more than just ActionScript here and might be able to help :)


Posted by Utopian in SWF Studio V3 on May 13 2008, 08:45 pm

The calling application is NSIS ( http://nsis.sourceforge.net). This is a language designed for installers, but I use it to create generic Windows executables.

The code in question is straight-forward. In the foo example, it would be:

Exec "flash\foo.exe"

In theory, NSIS should be able to set the working directory with SetOutPath, but that doesn't seem to work...


Posted by Utopian in SWF Studio V3 on May 14 2008, 01:37 pm

The other app is in NSIS. This language is designed for installers, but I use it for small "utility" executables.

My NSIS code is simple, I just call "exec"

SetOutPath "C:\flash"
Exec "C:\flash\foo.exe"

I've posted a query on the NSIS forums:
http://forums.winamp.com/showthread.php?threadid=291779


Posted by Utopian in SWF Studio V3 on Jun 20 2008, 04:32 pm

Sorry for the delay. I posted earlier but for some reason it didn't stick.

The language in question is NSIS. This is primarily an installation tool, but it can be used for make handy .exe files which are small in size.

I've figured out that in NSIS, I can use SetOutPath to specify the working directory. So I think I'm all set now.


Posted by northcode in SWF Studio V3 on Jun 20 2008, 07:57 pm

Your posts were marked for moderation because you included a link and you're new here. That keeps the spammers away, but can be a bit annoying for new users.

Glad you got it sorted out and sorry we didn't approve your posts sooner but the forum didn't show them to us. Time for an upgrare to the latest version of vBulletin maybe :)