473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to run Self extracting ZIP file from C# Application

Iam trying to open an self extracting zip file from my windows
application. it opens an command window and does not do any thing
afterwards. here is the code iam doing it.

System.Diagnostics.Process proc = new
System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = filename;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.UseShellExecute = false;
proc.Start();

Thanks
Ravi

Nov 17 '05 #1
4 5938
Ravi,

You want to set UseShellExecute to true, I believe, so that the OS
handles the call (instead of having the os execute the file directly).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ravi" <ra*******@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Iam trying to open an self extracting zip file from my windows
application. it opens an command window and does not do any thing
afterwards. here is the code iam doing it.

System.Diagnostics.Process proc = new
System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = filename;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.UseShellExecute = false;
proc.Start();

Thanks
Ravi

Nov 17 '05 #2
Nicholas,

Itried to setting
proc.StartInfo.UseShellExecute = true

but it still doesnot work.

Thanks
Ravi

Nov 17 '05 #3
Ravi,
are you sure that the "filename" field holds the FULL path to the file?
e.g., filename = @"C:\Temp\myzip.exe";

This works fine for me using your exact code snippet.
Peter

"Ravi" <ra*******@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Iam trying to open an self extracting zip file from my windows
application. it opens an command window and does not do any thing
afterwards. here is the code iam doing it.

System.Diagnostics.Process proc = new
System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = filename;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.UseShellExecute = false;
proc.Start();

Thanks
Ravi

Nov 17 '05 #4
Nicholas,

Iam passing filename="C:\\test\\myzip.exe"
It still not working.

The workaround i found is i created a batch file which takes the path
and file name as input parametes and runs the file. And i call the
batch file from code.

Thanks
Ravi

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nazgul | last post by:
Hi! I want to implement a small tool in Python for distributing "patches" and I need Your advice. This application should be able to package all files chosen by a user into a self-extracting.exe...
10
by: Calvin FONG | last post by:
Dear all, Are there any utility that can be call by python to create self extracting zip file. I'm now using the powerarchiever. But the command line options aren't flexible enough. Basically, I...
2
by: Avi | last post by:
hi, Can anyone tell me what the problem is and how to solve it The following piece of code resides on an asp page on the server and is used to download files from the server to the machine...
3
by: wenz | last post by:
Hi I have an exe which is actually a self-extracting zip file that i would like to run to extract all the files. I have the code showing how to use the j# classes and library to extract zip files...
0
by: k_nil | last post by:
I have a link on my web page for a self extracting executable file placed on the server. When the link is clicked, 1) i could see dialog box with open or save options 2) when open clicked, self...
1
by: Terry Olsen | last post by:
Ok, now that I've got my disk imager program working, I'd like to attach a "self-extractor" to the front end of the image file and make it a self-extracting disk image executable file. The idea...
2
by: bjm | last post by:
I created a self extracting zip file with about 9000 files in it. I extracted it manually from the command line without a problem. However, when I tried to do the same extraction at the same...
6
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has...
1
by: luckyshahoo | last post by:
I have to create a C# windows application that will take 4 different kind of files (a.exe, b.dll, c.doc etc....) and the application should generate a .exe say "MySetup.exe" file (self extracting...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.