private void AppShortcutToDesktop(string linkName)
{
string deskDir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
using (StreamWriter writer = new StreamWriter(deskDir + "\\" + linkName + ".url"))
{
string app = config.ProductPath + "/" + config.ProductName + ".exe";
writer.WriteLine("[InternetShortcut]");
writer.WriteLine("URL=file:///" + app);
writer.WriteLine("IconIndex=0");
string icon = app.Replace('\\', '/');
writer.WriteLine("IconFile=" + icon);
writer.Flush();
}
}<span style="white-space:pre"> </span>
我是代码帮运工。
至此,基本要用的东西都到位了。工程在这里:https://github.com/junxuehe/Unity-CreateAnInstall