Good evening,
How to include a registry file inside executable? and how to extract it after compilation?
Apricate any help.
Including registry file inside executable
Re: Including registry file inside executable
Search for IncludeBinary and DataSection.
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: Including registry file inside executable
Good evening Maya
I can help you if you want to write it to a file on execution, then do something with that file. I'm not sure if you want to process the registry data in some other way, but there are fairly straightforward ways of writing registry values in other posts on the forum, such as this one... https://www.purebasic.fr/english/viewtopic.php?t=82862
The below will create a local file at execution time, from the compile-time include of test.reg.
I can help you if you want to write it to a file on execution, then do something with that file. I'm not sure if you want to process the registry data in some other way, but there are fairly straightforward ways of writing registry values in other posts on the forum, such as this one... https://www.purebasic.fr/english/viewtopic.php?t=82862
The below will create a local file at execution time, from the compile-time include of test.reg.
Code: Select all
DataSection
RegfileDataStart:
IncludeBinary "x:\includedata\test.reg"
RegfileDataEnd:
EndDataSection
If CreateFile(0, "x:\includedata\regcopy.txt")
WriteData(0, ?RegfileDataStart, ?RegfileDataEnd - ?RegfileDataStart)
CloseFile(0)
Else
MessageRequester("Error creating file", "Unable to create included data")
EndIf-
Maya
Re: Including registry file inside executable
Good Morning Oso,
You've really helped me a lot.
Thank you very much!
Re: Including registry file inside executable
Good morning Maya, I'm glad to have been able to help you a bit — it isn't often that I get the chance, being relatively new to PB myselfMaya wrote: Thu Dec 07, 2023 6:32 am Good Morning Oso, You've really helped me a lot.
Thank you very much!

