|
发表于 2020-1-6 18:15:01
|
显示全部楼层
创建一个安装类:
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+"/";
sw = new StreamWriter(File.Open(Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop).ToString() + "\\卓帆信息考试系统.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,把该项目主输出添加到安装项目中,然后添加到自定义操作中。 |
|