Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 12-19-2001, 01:32 PM
Raver Raver is offline
Senior Member
 
Join Date: May 2001
Posts: 525
Default Run a EXE RESOURCE file ... (Read Inside)

Hi

I Have a DLL beside my application.
Its my RESOURCE file
I have some pictures and some Wave file inside
this resoure file named (Test.dll)

So I add a EXECUTE file into that file
as RC_DATA resource
so I can Extract this resource and run this
EXECUTE file.

But I have a question ,
How can I run this [exe] file driectly from
my resource file without any extracting !
Is it possible at all ?
If its , so please give me some code.

Be the way I want to :

RUN A EXE FILE DRIECTLY FROM A RESOURCE FILE
WHEN THIS EXE FILE IS AS A RC_DATA FILE
IN MY RESOURCE FILE


Regards
Bye

Raver
Reply With Quote
  #2  
Old 12-19-2001, 02:11 PM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default RE: Run a EXE RESOURCE file ... (Read Inside)

You can't do this under Windows...

gLes

"Tomorrow is the first day of the rest of your life!"
/gLes@hab.hu/
Reply With Quote
  #3  
Old 12-19-2001, 02:16 PM
tongalite tongalite is offline
Senior Member
 
Join Date: Apr 2001
Posts: 250
Default RE: Run a EXE RESOURCE file ... (Read Inside)

hi,
here is example to compile an exe into a RES file and run it directly from the RES by clicking a button in the main
exe:


with notepad make a .rc file that looks like this:

TESTFILE EXEFILE C:\TEST.EXE

and save as myres.rc

compile myres.rc with brcc32 to get myres.res then make sure myres.res is in same dir as project.

***********************************************

{$R MYRES.RES}

procedure ExtractRes(ResType, ResName, ResNewName : String);
var
Res : TResourceStream;
begin
Res := TResourceStream.Create(Hinstance, Resname, Pchar(ResType));
Res.SavetoFile(ResNewName);
Res.Free;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
ExtractRes('EXEFILE','TESTFILE','C:\TEST_EXE_FROM_ RES.EXE');
ShellExecute(Form1.Handle,'open','c:\Test_exe_from _res.exe',nil,nil,SW_SHOWNORMAL);
end;
end.
*********************************************
Have fun!
T.






The greatest accomplishments cannot be achieved without
the greatest of struggles!
Reply With Quote
  #4  
Old 12-19-2001, 02:33 PM
Raver Raver is offline
Senior Member
 
Join Date: May 2001
Posts: 525
Default Thank You

Hi

Thank You T. for your Kind answer.
But your code Extracts the EXE file into
the Hard Disk , as I said I dont want to
Extract That.

I think Its not possible , as gLes said.

I Have 2 choices :

1) have to EXTRACT it.
2) or make some code to do it (Just Kiddin')

Thank You for your kind answers.
Regards

Bye
Reply With Quote
  #5  
Old 12-19-2001, 02:40 PM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default RE: Thank You

To be honest it is possible in some way...if you extract the executable to a ramdisk it won't be on the harddrive will it?

Anyway I think there is no point of doing this...mostly because the purpose of dynamic link libraries (DLLs) is just the same...why play around with executables in the resources when you can add the code to a DLL and use it from there? well?

gLes

"Tomorrow is the first day of the rest of your life!"
/gLes@hab.hu/
Reply With Quote
  #6  
Old 12-19-2001, 02:53 PM
Raver Raver is offline
Senior Member
 
Join Date: May 2001
Posts: 525
Default Because ...

Hi gLes

I have some MOVIES in my application
I made them Using [Lotus SCREEN CAM].
It can create an EXE file instead of AVI file.
I can capture movie about 5 or more minutes.
it will be only around 1 Megabyte of SIZE !
But if I use AVI format for my MOVIES , one of
them (5 minutes) will be around 3-6 MegaBytes of SIZE !

I use different codec (Like MPEG-4 or DivX) , but
they are not as small as Lotus SCREEN CAM exe files !

So I have to choose this kind of format for my MOVIES.
So I want to RUN them when i need them.

If I put these exe files in my PACKEGE , its not good huh !
SO I renamed them to the different extension (.MVI)
and then I put them in some DLL RESOURCE files.

But I have to extract them first (
This is my problem
because of the HACKERS

So anyways
I have to EXTRACT one by one
I think so

Thank You again
Regards
Bye

RAVER
Reply With Quote
Reply

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 On

Forum Jump


All times are GMT. The time now is 05:08 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.