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:
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.
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.
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.
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 :)
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:
In theory, NSIS should be able to set the working directory with SetOutPath, but that doesn't seem to work...
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"
I've posted a query on the NSIS forums:
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.
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 :)