Page 1 of 1

Include external exes in your program?

Posted: Wed Nov 24, 2010 12:50 pm
by wmorton
I've just been using a program done in AutoHotKey that works by having command-line executables contained within the AHK exe, and when you run the program it unpacks the command-line exes to the windows temp folder then the AHK program acts as a front end for them.

Is it possible to do this within PB? I don't know where to look or what to search for.

Thanks

Re: Include external exes in your program?

Posted: Wed Nov 24, 2010 12:59 pm
by Trond
Something like this should work:

Code: Select all

CreateFile(0, GetTemporaryDirectory() + "extracted_filename.exe")
WriteData(0, ?MyFile, ?MyFileEnd-?MyFile)
CloseFile(0)

; RunProgram(GetTemporaryDirectory() + "extracted_filename.exe")

DataSection
  MyFile:
  IncludeBinary "file.exe"
  MyFileEnd:

EndDataSection


Re: Include external exes in your program?

Posted: Wed Nov 24, 2010 1:05 pm
by wmorton
Fantastic, thanks!