Record the issue about calling RAR Decompression

Source: Internet
Author: User

The second write is related to calling RAR for decompression. Record the problem.

The first time I wrote a Demo, I tried to upgrade and overwrite my website through RAR decompression.

Problems encountered during the first write:

1. In XP, extract and overwrite the directory of the running Asp.net program on the Web (overwrite itself ). Error-"exception: you cannot overwrite yourself in the process

The solution is to create an application domain to solve this problem!

Then, we put the project on the Windows 2003 desktop and called it to decompress the project. However, we don't know what to decompress.

The reason is: the desktop involves multiple user problems, and it is normal to put it on the CDEF disk.

Then, place the project in the other drive of Win 2003 and decompress it normally.

The reason should be: xp iis and Win 2003 IIS have different principles. Xp is a single process, and 2003 is a multi-process.

 

The second time is the Winform installation package.

By calling RAR to decompress the installation project, the following error occurs:

1. There are spaces in the decompression path, so an error occurred. It took a long time to find out.

The solution is to enclose the path with double quotation marks if it contains spaces.

2. Online command lines do not have backend running parameters

The solution is to search separately and find the "-ibck"

 

Send the following code:

 

Code

Public bool WARToFoler (string rarFromPath, string rarToPath)
{
Process rarPro = new Process ();
RarPro. StartInfo. FileName = AppConfig. SoftSetup_WinRARSystemPath;
RarPro. StartInfo. Arguments = string. Format ("x \" {0} \ "\" {1} \ "-o +-r-ibck", rarFromPath, rarToPath );
RarPro. StartInfo. UseShellExecute = false;
RarPro. StartInfo. RedirectStandardInput = true;
RarPro. StartInfo. RedirectStandardOutput = true;
RarPro. StartInfo. RedirectStandardError = true;
RarPro. StartInfo. CreateNoWindow = true;
RarPro. StartInfo. WindowStyle = ProcessWindowStyle. Hidden;
RarPro. OutputDataReceived + = new System. Diagnostics. DataReceivedEventHandler (p_OutputDataReceived );
RarPro. ErrorDataReceived + = new DataReceivedEventHandler (rarPro_ErrorDataReceived );
RarPro. Start (); // Extract
RarPro. BeginOutputReadLine ();
RarPro. BeginErrorReadLine ();
RarPro. WaitForExit ();
RarPro. Dispose ();
Return IsOK;
}
Void rarPro_ErrorDataReceived (object sender, DataReceivedEventArgs e)
{
If (e. Data! = Null & e. Data! = "")
{
OutMsg. Text + = "failed:" + e. Data + "\ r \ n ";
IsOK = false;
}
}
Void p_OutputDataReceived (object sender, System. Diagnostics. DataReceivedEventArgs e)
{
If (e. Data! = Null & e. Data! = "")
{
OutMsg. Text + = "success:" + e. Data + "\ r \ n ";
}
}

 

 

I won't get the RAR parameter command. I heard that the help document of the RAR installation directory contains: I cannot open the cracked version.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.