C # automatic installation of the production disc

Source: Internet
Author: User
When a user installs the software, the CD is placed into the optical drive, and the CD runs automatically for installation. How does this function be implemented? This example describes how to create an "automatically installed CD program ". The executable file is executed during automatic playback of the disc, the Autorun. ICO is the disc icon, and the autorun. inf is an INI file. As long as these files are included in the CD, the CD will automatically run when it is placed into the optical drive.

Development Process:
(1) create a project named autorun, a console application.
(2) Main program code.

1 using Microsoft. Win32;
2 using system;
3 using system. diagnostics;
4 using system. IO;
5 internal class Autorun
6 {
7 Private Static void main (string [] ARGs)
8 {
9 processstartinfo info1 = new processstartinfo ();
10 process process1 = new process ();
11 string basefile = appdomain. currentdomain. basedirectory;
12 console. writeline ("Boot installation ...");
13 info1.filename = basefile + "application installation package .exe ";
14 process1.startinfo = info1;
15 process1.start ();
16 process1.waitforexit ();
17 process1.close ();
18 console. writeline ("program installation completed ");
19}
20}

 

(3rd runtime program, the executable file is named “autorun.exe ", which is the file opened during automatic playback of the CD. This file is used to guide the application installation package for installation.
(4) Select an icon named "autorun. ICO", which is displayed when the drive is read.
(5th, when the optical disc is used, the original autorun.icow.{autorun.inf;{{autorun.exe "and the installation package of the application to be installed are put together in the burning file to the CD.

Autorun. inf Creates a text file and saves it as INF. The content is as follows:

[Autorun]
Open = Autorun. exe
Icon = Autorun. ICO

Summary:
You can develop the following programs based on this instance:
1. Design a multimedia promotional disc.
2. Create a backdoor program.

Problem:

Autorun.exe is automatically started every time the optical disk is released. A DoS interface is displayed, which is obviously unfriendly! I don't know how to solve this problem?

Related Article

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.