![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Expert Programmer
|
Why make it over-complicated?
The use of an installer would seem to be overkill if all you want are a couple of OCX's and text files. The standard way to do it is to check if the files exist when your app starts up (sub main or the load event) - if not then extract them, in a way like this
As for compression, you can use any one of a number of native VB code - based algorithms; RLE will do but I prefer LZSS (WinZip basically) - using an obscure activeX control to overcome these problems is unwise, as what happens if the end-user doesn't have it? NSIS requires a framework that'd need to be bundled being almost a language in itself, and the Package and Deployment wizard is inflexible and unreliable at times. (End general rant about the software world!) If you want a bit more, but don't want to go down the InstallShield route, you might want to consider writing a really simple install program in a similar way, enabling you to code and design dialogs to your heart's content. As for launching EXE's, Shell will do, unless you want your app to wait until the executed program has finished, in which case you need to go down the API Mutex and all route. Hope this helps and didn't get too irrelevant... |
|
|
|
|
|
#12 | |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
ahh
![]() thanks alot, seems like a nice way of doing it ![]() however, would it be possible to edit the text files that have been embedded? the thing im really trying to achieve is my setup program will be where things are configured then i want those config files and dlls (all in same dir) to be automaticly built into another exe (the main program) by the click of a button. is it possible to do this using this method? thanks very much rory ^^ and magic_e what's psc? Quote:
|
|
|
|
|
|
|
#13 |
|
Programmer
Join Date: Jan 2005
Posts: 44
Rep Power: 0
![]() |
sorry cloud-, psc is planet-source-code.com it's place were other people post code for others to view and use as examples
magic e |
|
|
|
|
|
#14 |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
nice, that site has lots of useful codes
thanks ^_^ |
|
|
|
|
|
#15 |
|
Expert Programmer
|
Right, self-modifying executables. There are two main ways of attaching stuff inside an EXE. First up is the general "append data" method beloved by WinZip self-extractor NSIS and most pie-crust install Stubs like the ACME install (Microsoft) whereby you precompile an all-purpose stub (called a stub because the data in this basic EXE is at the start of the file). Then you append the data that contains the information about the install afterwards, which won't affect the EXE as data after the end of the PE command stucture is not executed. First of all you'll need to write some clever code to get at the stuff appended in the stub EXE - remember use the statement Open app.path & "\" & app.exename & ".exe" for binary access read as #1 to prevent the lock on the file (by itself) throwing an error. Then you'll need to find some way of getting the position within the file at which the appended data starts - I would suggest writing an 8 digit number or something at the very end, and then the appended data could be read from the 8 digit number position to the length of the file minus this number minus 8. [Thinking like this may hurt the brain but a byte here and there out of place could break everything]. Then you'd need to figure out a way of processing it.
Alternatively you can edit the resource information contained within the file (the kind of thing you can do with resource hacker). I've seen a few pie crust modules that provide this functionality, although the Windows APIs are also useful. Using either of these methods you can also update the contents of the file - I would recommend using the resource file method for simplicity, though be aware that self-modifying EXE's can set off a few heuristic virus guards. Hope this helps. |
|
|
|
|
|
#16 |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
thanks alot for all the help ^^
i decided to go with the resource files method. ![]() thanks |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|