https://www.cnblogs.com/gc2013/p/3820746.html
例:
using Microsoft.Win32;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.Threading.Tasks;
namespace SetupInit
{
[RunInstaller(true)]
public partial class Installer : System.Configuration.Install.Installer
{
public Installer()
{
InitializeComponent();
}
public override void Install(IDictionary stateSaver)
{
RegistryKey key = Registry.ClassesRoot;
RegistryKey software = key.CreateSubKey("VideoMeeting");
software.SetValue("", "URL:自定义协议");
software.SetValue("URL Protocol", "URL Protocol");
software.Close();
software = Registry.ClassesRoot.CreateSubKey(@"VideoMeeting\shell");
software.Close();
software = Registry.ClassesRoot.CreateSubKey(@"VideoMeeting\shell\open");
software.Close();
software = Registry.ClassesRoot.OpenSubKey(@"VideoMeeting\shell\open", true);
RegistryKey aimdir = software.CreateSubKey("command");
var path = Context.Parameters["TARGETDIR"].ToString() + "zoom_sdk_demo.exe";
aimdir.SetValue(@"", "\"" + path + "\" \" %1\"");
software.Close();
aimdir.Close();
base.Install(stateSaver);
}
}
}
static void Main(string[] args)