better-genshin-impact/Build/MicaSetup/Program.un.cs

73 lines
2.6 KiB
C#
Raw Permalink Normal View History

using MicaSetup.Design.Controls;
using MicaSetup.Services;
using MicaSetup.Views;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: Guid("00000000-0000-0000-0000-000000000000")]
[assembly: AssemblyTitle("BetterGI Uninst")]
[assembly: AssemblyProduct("BetterGI")]
[assembly: AssemblyDescription("BetterGI Uninst")]
[assembly: AssemblyCompany("Lemutec")]
[assembly: AssemblyCopyright("Under GPL-3.0 license. Copyright (c) better-genshin-impact Contributors.")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
namespace MicaSetup;
internal class Program
{
[STAThread]
internal static void Main()
{
Hosting.CreateBuilder()
.UseAsUninst()
.UseLogger()
.UseSingleInstance("BetterGI_MicaSetup")
.UseTempPathFork()
.UseElevated()
.UseDpiAware()
.UseOptions(option =>
{
option.IsCreateDesktopShortcut = true;
option.IsCreateUninst = true;
option.IsCreateRegistryKeys = true;
option.IsCreateStartMenu = true;
option.IsCreateQuickLaunch = false;
option.IsCreateAsAutoRun = false;
option.IsUseRegistryPreferX86 = null!;
option.IsAllowFirewall = true;
2023-12-17 14:57:31 +08:00
option.IsRefreshExplorer = true;
option.IsInstallCertificate = false;
option.ExeName = @"BetterGI.exe";
option.KeyName = "BetterGI";
option.DisplayName = "BetterGI";
option.DisplayIcon = @"BetterGI.exe";
option.DisplayVersion = "0.0.0.0";
option.Publisher = "babalae";
option.AppName = "BetterGI";
option.SetupName = $"BetterGI {Mui("UninstallProgram")}";
})
.UseServices(service =>
{
service.AddSingleton<IMuiLanguageService, MuiLanguageService>();
service.AddScoped<IExplorerService, ExplorerService>();
})
.CreateApp()
.UseMuiLanguage()
.UseTheme(WindowsTheme.Auto)
.UsePages(page =>
{
page.Add(nameof(MainPage), typeof(MainPage));
page.Add(nameof(UninstallPage), typeof(UninstallPage));
page.Add(nameof(FinishPage), typeof(FinishPage));
})
.UseDispatcherUnhandledExceptionCatched()
.UseDomainUnhandledExceptionCatched()
.UseUnobservedTaskExceptionCatched()
.RunApp();
}
}