trying to get on startup working correctly

This commit is contained in:
Martin Barker
2023-11-07 00:43:10 +00:00
parent ac7e305de5
commit 6266bc65e7
4 changed files with 21 additions and 15 deletions

View File

@@ -549,7 +549,7 @@ end;
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{7774CEEE-6785-48B9-BA35-6B842F947A21}
AppName=Twitchy
AppVersion=0.4.0
AppVersion=0.4.1
;AppVerName={#MyAppName} {#MyAppVersion}
DefaultDirName={autopf}\Twitchy
DisableProgramGroupPage=yes
@@ -560,6 +560,7 @@ OutputDir=.\SetupFiles
OutputBaseFilename=TwitchySetup
SetupIconFile=.\TwitchDesktopNotifications\Assets\icon.ico
UninstallDisplayIcon=.\TwitchDesktopNotifications\Assets\icon.ico
WizardSmallImageFile=.\TwitchDesktopNotifications\Assets\twitch.bmp
Compression=lzma
SolidCompression=yes
WizardStyle=modern
@@ -571,16 +572,17 @@ SourceDir=.\
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "autostarticon"; Description: "{cm:AutoStartProgram,Twitchy}"; GroupDescription: "{cm:AdditionalIcons}";
[Files]
Source: "TwitchDesktopNotifications\bin\x64\ReleaseSign\net6.0-windows10.0.17763.0\Twitchy.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\x64\ReleaseSign\net6.0-windows10.0.17763.0\Microsoft.Toolkit.Uwp.Notifications.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\x64\ReleaseSign\net6.0-windows10.0.17763.0\Microsoft.Windows.SDK.NET.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\x64\ReleaseSign\net6.0-windows10.0.17763.0\Twitchy.deps.json"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\x64\ReleaseSign\net6.0-windows10.0.17763.0\Twitchy.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\x64\ReleaseSign\net6.0-windows10.0.17763.0\Twitchy.runtimeconfig.json"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\x64\ReleaseSign\net6.0-windows10.0.17763.0\WinRT.Runtime.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\x64\ReleaseSign\net6.0-windows10.0.17763.0\Assets\icon.ico"; DestDir: "{app}\Assets"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\x64\ReleaseSign\net6.0-windows10.0.17763.0\Assets\twitch.png"; DestDir: "{app}\Assets"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\Release\net6.0-windows10.0.17763.0\Twitchy.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\Release\net6.0-windows10.0.17763.0\Microsoft.Toolkit.Uwp.Notifications.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\Release\net6.0-windows10.0.17763.0\Microsoft.Windows.SDK.NET.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\Release\net6.0-windows10.0.17763.0\Twitchy.deps.json"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\Release\net6.0-windows10.0.17763.0\Twitchy.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\Release\net6.0-windows10.0.17763.0\Twitchy.runtimeconfig.json"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\Release\net6.0-windows10.0.17763.0\WinRT.Runtime.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\Release\net6.0-windows10.0.17763.0\Assets\icon.ico"; DestDir: "{app}\Assets"; Flags: ignoreversion
Source: "TwitchDesktopNotifications\bin\Release\net6.0-windows10.0.17763.0\Assets\twitch.png"; DestDir: "{app}\Assets"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: "netcorecheck.exe"; Flags: dontcopy noencryption
Source: "netcorecheck_x64.exe"; Flags: dontcopy noencryption

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@@ -1,4 +1,5 @@
// See https://aka.ms/new-console-template for more information
using Microsoft.Toolkit.Uwp.Notifications;
using System.Drawing;
using System.Reflection.Metadata;
using System.Runtime.InteropServices;
@@ -128,6 +129,10 @@ internal class Program
thread.Start();
Application.Run();
Application.ApplicationExit += (object? sender, EventArgs e) => {
ToastNotificationManagerCompat.Uninstall();
};
}
catch (Exception e) {
Logger.GetInstance().Writer.WriteLineAsync(e.ToString());

View File

@@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Twitchy"
#define MyAppVersion "0.4.0"
#define MyAppVersion "0.4.2"
#define MyAppExeName "Twitchy.exe"
#ifndef MyAppTargetFramework
@@ -22,7 +22,6 @@
AppId={{7774CEEE-6785-48B9-BA35-6B842F947A21}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=.\TwitchDesktopNotifications\Lisence.rtf
@@ -32,6 +31,7 @@ OutputDir=.\SetupFiles
OutputBaseFilename=TwitchySetup
SetupIconFile=.\TwitchDesktopNotifications\Assets\icon.ico
UninstallDisplayIcon=.\TwitchDesktopNotifications\Assets\icon.ico
WizardSmallImageFile=.\TwitchDesktopNotifications\Assets\twitch.bmp
Compression=lzma
SolidCompression=yes
WizardStyle=modern
@@ -45,6 +45,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "autostarticon"; Description: "{cm:AutoStartProgram,{#MyAppName}}"; GroupDescription: "{cm:AdditionalIcons}";
[Files]
Source: "{#SourceDir}{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
@@ -65,13 +66,11 @@ Source: "netcorecheck_x64.exe"; Flags: dontcopy noencryption
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: autostarticon
[Run]
Filename: {app}\{cm:AppName}.exe; Description: {cm:LaunchProgram,{cm:AppName}}; Flags: nowait postinstall skipifsilent
[Registry]
Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Twitchy"; ValueData: """{app}\{#MyAppExeName}"""; Flags: uninsdeletevalue
[CustomMessages]
AppName=Twitchy
LaunchProgram=Start Twitchy after finishing installation