Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 5th, 2005, 5:20 PM   #11
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
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...
Rory is offline   Reply With Quote
Old Feb 6th, 2005, 2:14 PM   #12
cloud-
Hobbyist Programmer
 
Join Date: Jan 2005
Posts: 110
Rep Power: 4 cloud- is on a distinguished road
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:
try psc for examples
thanks again for all your help
cloud- is offline   Reply With Quote
Old Feb 6th, 2005, 5:05 PM   #13
magic_e
Programmer
 
Join Date: Jan 2005
Posts: 44
Rep Power: 0 magic_e is on a distinguished road
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
magic_e is offline   Reply With Quote
Old Feb 7th, 2005, 7:16 AM   #14
cloud-
Hobbyist Programmer
 
Join Date: Jan 2005
Posts: 110
Rep Power: 4 cloud- is on a distinguished road
nice, that site has lots of useful codes

thanks ^_^
cloud- is offline   Reply With Quote
Old Feb 7th, 2005, 7:41 AM   #15
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
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.
Rory is offline   Reply With Quote
Old Feb 8th, 2005, 4:32 PM   #16
cloud-
Hobbyist Programmer
 
Join Date: Jan 2005
Posts: 110
Rep Power: 4 cloud- is on a distinguished road
thanks alot for all the help ^^
i decided to go with the resource files method.


thanks
cloud- is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:39 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC