|
Create an installation class:
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration.Install;
using System.DirectoryServices;
using System.IO;
public steup ()
{
try
{
string strVirtualDir = Context.Parameter ["assemblypath"]. ToString ();
string [] arrDir = strVirtualDir.Split ('\\');
strVirtualDir = arrDir [arrDir.Length-2];
StreamWriter sw;
string t = "http: //" + System.Net.Dns.GetHostName () + "/" + strVirtualDir + "/";
Ranch
sw = new StreamWriter (File.Open (Environment.GetFolderPath (System.Environment.SpecialFolder.Desktop) .ToString () + "\\Zhuo Fan Information Test System.url", FileMode.Create, FileAccess.Write));
sw.WriteLine ("[InternetShortcut]");
sw.WriteLine ("URL =" + t + "");
sw.WriteLine ("modified = 2329483928383");
sw.Flush ();
sw.Close ();
InstallLibrary.LogoIcon.WriteReg (strRegPath);
//System.Diagnostics.Process.Start("http://bill/webexam/ ");
}
catch (Exception ex)
{
throw ex;
}
}
2. Add the main output of the project to the installation project, and then add it to the custom operation. |
|