SymphonyElectron/installer/win/WixSharpToolset/Samples/Shortcuts (advertised)/setup2.cs
2020-08-21 08:25:55 +02:00

38 lines
1.2 KiB
C#

//css_ref ..\..\WixSharp.dll;
//css_ref System.Core.dll;
//css_ref ..\..\Wix_bin\SDK\Microsoft.Deployment.WindowsInstaller.dll;
using System;
using System.Xml;
using Microsoft.Win32;
using System.Windows.Forms;
using WixSharp;
class Script
{
static public void Main(string[] args)
{
try
{
Project project =
new Project("My Product",
new Dir(@"%ProgramFiles%\My Company\My Product",
new File(@"AppFiles\MyApp.exe",
new FileShortcut("MyApp", @"%Desktop%") { AttributesDefinition = "Advertise=yes" })
new ExeFileShortcut("Uninstall MyApp", "[System64Folder]msiexec.exe", "/x [ProductCode]")),
new Dir(@"%ProgramMenu%\My Company\My Product",
new ExeFileShortcut("Uninstall MyApp", "[System64Folder]msiexec.exe", "/x [ProductCode]")));
project.GUID = new Guid("6fe30b47-2577-43ad-9095-1861ba25889b");
project.UI = WUI.WixUI_ProgressOnly;
project.OutFileName = "setup";
Compiler.BuildMsi(project);
}
catch (System.Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}