Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Extracting files from an EXE

Reply
Thread Tools

Extracting files from an EXE

 
 
Zagor
Guest
Posts: n/a
 
      03-18-2006
Hi All,
I have a small exe app ( basic a dialog box) that when lauched needs to
"copy" some files in a directory chosen by the user (within the dialog). I
cannot use an installation package because there are some particular tasks
to be done from the exe.
Anyhow I was wondering if it possibile to include files within the (C#)exe
and then extract them from the exe when launched...sort of an installation.
I was thinking to add them as resources but I do not know how to extract
them.

Please any hint will be appreciated

Thank you
Zagor


 
Reply With Quote
 
 
 
 
SStory
Guest
Posts: n/a
 
      03-28-2006
There is Zip genius software.

You can zip a file and then direct it unzip all files to a directory and
then run an exe if it is named Setup.exe.

That would get the files in a directory and then run your exe.

Otherwise, this sounds a lot like a virus.


"Zagor" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi All,
> I have a small exe app ( basic a dialog box) that when lauched needs to
> "copy" some files in a directory chosen by the user (within the dialog). I
> cannot use an installation package because there are some particular tasks
> to be done from the exe.
> Anyhow I was wondering if it possibile to include files within the (C#)exe
> and then extract them from the exe when launched...sort of an
> installation.
> I was thinking to add them as resources but I do not know how to extract
> them.
>
> Please any hint will be appreciated
>
> Thank you
> Zagor
>



 
Reply With Quote
 
 
 
 
VJ
Guest
Posts: n/a
 
      04-15-2006
Are you looking to extract the embbedded files from the exe to extract when
your exe launches?.. If the answer is yes... then here is what you do... in
your code at you can do this..

string includeFileName = "MyApplication.MySapce.Trial.jpg";
string strNewPathToSave = @"C:\MyNewPath\Trial.jpg";

System.IO.Stream myFile
= System.Reflection.Assembly.GetManifestResourceStre am(includeFileName);

if ( myFile== null )
return "Unable to read the License file."; //"Inspherion License file is
not valid. Please contact Inspherion Support";

System.IO.FileStream fs = System.IO.File.OpenWrite(strNewPathToSave);
try
{
// Save the File...
byte[] buffer = new byte[myFile.Length];
myFile.Read(buffer,0,(int)myFile.Length);
fs.Write(buffer,0,buffer.Length);
}
finally
{
fs.Close();
}

Remeber that.. the includeFileName has to be fully qualified with Namespace
used by the executable or assembly where the file is embbeded.

HTH
VJ

"Zagor" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi All,
> I have a small exe app ( basic a dialog box) that when lauched needs to
> "copy" some files in a directory chosen by the user (within the dialog). I
> cannot use an installation package because there are some particular tasks
> to be done from the exe.
> Anyhow I was wondering if it possibile to include files within the (C#)exe
> and then extract them from the exe when launched...sort of an
> installation.
> I was thinking to add them as resources but I do not know how to extract
> them.
>
> Please any hint will be appreciated
>
> Thank you
> Zagor
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Explorer 8: C:\Program Files\Internet Explorer\iexplore.exe vs C:\Program Files (x86)\Internet Explorer\iexplore.exe Nathan Sokalski Windows 64bit 16 02-22-2010 08:31 AM
Best utility for extracting exe files? Reshack or Zip Genius? hmmm@hmmm.org Computer Support 15 08-18-2007 03:31 PM
extracting text from files using IFilters kunal ASP .Net 0 10-15-2005 11:09 AM
Strange files - avserve2.exe & xaeulrzu.exe Gameface Computer Support 2 06-24-2004 04:23 AM
Help please......Can't open self extracting exe files moorsky Computer Support 1 12-22-2003 03:28 PM



Advertisments