Create EXE?
-
sharkbate24
- User

- Posts: 50
- Joined: Sat Aug 30, 2008 3:21 pm
Create EXE?
Hello everyone,
I want to have a go at making an Update Patcher, where the user can create patches for his program / game. I want to know how I can go abouts creating an EXE file from a program I create, after the user presses a button?
Thanks everyone.
I want to have a go at making an Update Patcher, where the user can create patches for his program / game. I want to know how I can go abouts creating an EXE file from a program I create, after the user presses a button?
Thanks everyone.
[Registed PB User]
[Windows XP SP2 | PureBasic 4.20]
[Windows XP SP2 | PureBasic 4.20]
Code: Select all
OpenWindow(0, #PB_Ignore, #PB_Ignore, 100, 50, "PatchCreater", #PB_Window_SystemMenu)
CreateGadgetlist(WindowID(0))
ButtonGadget(0, 10, 10, 80, 30, "create")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow : Break
Case #PB_Event_Gadget
If EventGadget() = 0
If CreateFile(0, "Patcher.exe")
For i = 0 To 1000
WriteLong(0, Random(999999))
Next
CloseFile(0)
MessageRequester("PatchCreater", "Patch successfull created")
End
EndIf
EndIf
EndSelect
ForEverPureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

- Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
- DoubleDutch
- Addict

- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- Rook Zimbabwe
- Addict

- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
- DoubleDutch
- Addict

- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Sorry Rook, your wrong...
Fallout3 will be larger than 4KB
(plus a larger random number [-1?] would be needed)
Fallout3 will be larger than 4KB
(plus a larger random number [-1?] would be needed)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- Joakim Christiansen
- Addict

- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
Well, he probably want to include a exe and then extract it...
Like this:
Like this:
Code: Select all
DataSection
ExeFile: IncludeBinary "whatever.exe"
DataEnd:
EndDataSection
If CreateFile(0,"whatever.exe")
WriteData(0,?ExeFile,?DataEnd-?ExeFile)
CloseFile(0)
EndIfI like logic, hence I dislike humans but love computers.
- DoubleDutch
- Addict

- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
After re-reading the first post I think your right - I though he wanted a system that could create the patch files (in which case http://kobik.net/codefusion.asp would do the job).
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
-
sharkbate24
- User

- Posts: 50
- Joined: Sat Aug 30, 2008 3:21 pm
- Rook Zimbabwe
- Addict

- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
OK 1 clue... LINKERs.
One way to make a program run in the old days was to use a LINKER at the end... OK my swiss cheese brain may be miscalling it but most BASIC compilers back in the day only had a small startup piece and then the basic code and then the tiny linker/COM runner at the end to run it!
If I am remembering correctly!

One way to make a program run in the old days was to use a LINKER at the end... OK my swiss cheese brain may be miscalling it but most BASIC compilers back in the day only had a small startup piece and then the basic code and then the tiny linker/COM runner at the end to run it!
If I am remembering correctly!

