Include external exes in your program?

Just starting out? Need help? Post your questions and find answers here.
wmorton
User
User
Posts: 81
Joined: Fri Jul 25, 2003 5:39 pm

Include external exes in your program?

Post 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
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Include external exes in your program?

Post 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

wmorton
User
User
Posts: 81
Joined: Fri Jul 25, 2003 5:39 pm

Re: Include external exes in your program?

Post by wmorton »

Fantastic, thanks!
Post Reply