Skip to content

Commit

Permalink
Fixed update file permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
tommaier123 committed Mar 6, 2024
1 parent 7a0b88c commit dfe37ac
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
28 changes: 14 additions & 14 deletions Installer/XBatteryStatus.aip
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<ROW Property="ARPURLINFOABOUT" Value="https://github.com/tommaier123/XBatteryStatus"/>
<ROW Property="ARPURLUPDATEINFO" Value="https://github.com/tommaier123/XBatteryStatus/releases"/>
<ROW Property="Manufacturer" Value="Nova_Max"/>
<ROW Property="ProductCode" Value="1033:{9956CBDD-0F4B-4857-B6EA-ED492063CDF3} " Type="16"/>
<ROW Property="ProductCode" Value="1033:{5E0FB4A6-A5E1-4BE0-930D-F34B64B592B6} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="XBatteryStatus"/>
<ROW Property="ProductVersion" Value="1.3.1" Options="32"/>
<ROW Property="ProductVersion" Value="1.3.2" Options="32"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
<ROW Property="UpgradeCode" Value="{93DDDD01-E50C-43CA-B3CB-EDF95BCEE958}"/>
<ROW Property="WindowsType9X" MultiBuildValue="x64_Release:Windows 9x/ME" ValueLocId="-"/>
Expand Down Expand Up @@ -56,13 +56,13 @@
<COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
<ROW Component="A9DBE469DEED46998DA553406739ED74" ComponentId="{A70B299E-1D39-4445-BC64-3C44D7316584}" Directory_="APPDIR" Attributes="260" KeyPath="A9DBE469DEED46998DA553406739ED74" Options="2"/>
<ROW Component="APPDIR" ComponentId="{F405CF0A-C71D-4E39-A2E9-6953D0661FC9}" Directory_="APPDIR" Attributes="0"/>
<ROW Component="Microsoft.Toolkit.Uwp.Notifications.dll" ComponentId="{7A05608B-067F-4F7C-B724-8A14C0DA7E39}" Directory_="APPDIR" Attributes="0" KeyPath="Microsoft.Toolkit.Uwp.Notifications.dll"/>
<ROW Component="Microsoft.Windows.SDK.NET.dll" ComponentId="{8AB0CD89-7750-4D66-BD09-52852D42C841}" Directory_="APPDIR" Attributes="0" KeyPath="Microsoft.Windows.SDK.NET.dll"/>
<ROW Component="Octokit.dll" ComponentId="{49AEB1AF-19AD-4A4B-A752-3A098A7FDEDE}" Directory_="APPDIR" Attributes="0" KeyPath="Octokit.dll"/>
<ROW Component="Microsoft.Toolkit.Uwp.Notifications.dll" ComponentId="{7ECE13B9-9AB4-4D9C-9ACD-54CE518C9E65}" Directory_="APPDIR" Attributes="0" KeyPath="Microsoft.Toolkit.Uwp.Notifications.dll"/>
<ROW Component="Microsoft.Windows.SDK.NET.dll" ComponentId="{C78876F1-7B96-48C2-92D2-4B12E8D8C9A1}" Directory_="APPDIR" Attributes="0" KeyPath="Microsoft.Windows.SDK.NET.dll"/>
<ROW Component="Octokit.dll" ComponentId="{5D472972-9EE1-4426-8E1B-BA10B7348AB7}" Directory_="APPDIR" Attributes="0" KeyPath="Octokit.dll"/>
<ROW Component="ProductInformation" ComponentId="{46644AA0-DF5A-46D4-A0D7-42A4EB2A769E}" Directory_="APPDIR" Attributes="260" KeyPath="Version"/>
<ROW Component="SHORTCUTDIR" ComponentId="{A0F6885D-225C-4B0F-963E-22EF909667EA}" Directory_="SHORTCUTDIR" Attributes="0"/>
<ROW Component="Store50x50Logo.scale100.png" ComponentId="{75FC1E3A-F24A-4FA5-BDB3-0AB167818E71}" Directory_="Assets" Attributes="0" KeyPath="Store50x50Logo.scale100.png" Type="0"/>
<ROW Component="WinRT.Runtime.dll" ComponentId="{D98FA433-4E1C-472A-967C-C63428423D62}" Directory_="APPDIR" Attributes="0" KeyPath="WinRT.Runtime.dll"/>
<ROW Component="WinRT.Runtime.dll" ComponentId="{F4358838-26F6-4C3E-8D86-838C16B9EA88}" Directory_="APPDIR" Attributes="0" KeyPath="WinRT.Runtime.dll"/>
<ROW Component="XBatteryStatus.dll" ComponentId="{73B7B72B-A2F5-47F7-AA0C-29084F109DA2}" Directory_="APPDIR" Attributes="256" KeyPath="XBatteryStatus.dll"/>
<ROW Component="XBatteryStatus.dll.config" ComponentId="{58AF43D0-AC0A-411F-B8D6-23BD92C04649}" Directory_="APPDIR" Attributes="0" KeyPath="XBatteryStatus.dll.config" Type="0"/>
<ROW Component="XBatteryStatus.exe" ComponentId="{3429B614-4145-48D1-B9B8-F0EC2D4E022D}" Directory_="APPDIR" Attributes="256" KeyPath="XBatteryStatus.exe"/>
Expand All @@ -78,10 +78,6 @@
<ROW File="XBatteryStatus.dll.config" Component_="XBatteryStatus.dll.config" FileName="XBATTE~1.CON|XBatteryStatus.dll.config" Attributes="0" SourcePath="..\XBatteryStatus\bin\x64\Release\net5.0-windows10.0.19041.0\XBatteryStatus.dll.config" SelfReg="false"/>
<ROW File="XBatteryStatus.runtimeconfig.json" Component_="XBatteryStatus.dll.config" FileName="XBATTE~1.JSO|XBatteryStatus.runtimeconfig.json" Attributes="0" SourcePath="..\XBatteryStatus\bin\x64\Release\net5.0-windows10.0.19041.0\XBatteryStatus.runtimeconfig.json" SelfReg="false"/>
<ROW File="XBatteryStatus.dll" Component_="XBatteryStatus.dll" FileName="XBATTE~1.DLL|XBatteryStatus.dll" Attributes="0" SourcePath="..\XBatteryStatus\bin\x64\Release\net5.0-windows10.0.19041.0\XBatteryStatus.dll" SelfReg="false"/>
<ROW File="Microsoft.Toolkit.Uwp.Notifications.dll" Component_="Microsoft.Toolkit.Uwp.Notifications.dll" FileName="MICROS~1.DLL|Microsoft.Toolkit.Uwp.Notifications.dll" Attributes="0" SourcePath="..\..\..\..\..\.nuget\packages\microsoft.toolkit.uwp.notifications\7.1.3\lib\net5.0-windows10.0.17763\Microsoft.Toolkit.Uwp.Notifications.dll" SelfReg="false"/>
<ROW File="Microsoft.Windows.SDK.NET.dll" Component_="Microsoft.Windows.SDK.NET.dll" FileName="MICROS~2.DLL|Microsoft.Windows.SDK.NET.dll" Attributes="0" SourcePath="..\..\..\..\..\.nuget\packages\microsoft.windows.sdk.net.ref\10.0.19041.26\lib\Microsoft.Windows.SDK.NET.dll" SelfReg="false"/>
<ROW File="Octokit.dll" Component_="Octokit.dll" FileName="Octokit.dll" Attributes="0" SourcePath="..\..\..\..\..\.nuget\packages\octokit\10.0.0\lib\netstandard2.0\Octokit.dll" SelfReg="false"/>
<ROW File="WinRT.Runtime.dll" Component_="WinRT.Runtime.dll" FileName="WINRTR~1.DLL|WinRT.Runtime.dll" Attributes="0" SourcePath="..\..\..\..\..\.nuget\packages\microsoft.windows.sdk.net.ref\10.0.19041.26\lib\WinRT.Runtime.dll" SelfReg="false"/>
<ROW File="XBatteryStatus.deps.json" Component_="XBatteryStatus.dll.config" FileName="XBATTE~2.JSO|XBatteryStatus.deps.json" Attributes="0" SourcePath="..\XBatteryStatus\bin\x64\Release\net5.0-windows10.0.19041.0\XBatteryStatus.deps.json" SelfReg="false"/>
<ROW File="XBatteryStatus.runtimeconfig.dev.json" Component_="XBatteryStatus.dll.config" FileName="XBATTE~3.JSO|XBatteryStatus.runtimeconfig.dev.json" Attributes="0" SourcePath="..\XBatteryStatus\bin\x64\Release\net5.0-windows10.0.19041.0\XBatteryStatus.runtimeconfig.dev.json" SelfReg="false"/>
<ROW File="Store50x50Logo.scale100.png" Component_="Store50x50Logo.scale100.png" FileName="STORE5~2.PNG|Store50x50Logo.scale-100.png" Attributes="0" SourcePath="..\Icons\png\icon.png" SelfReg="false"/>
Expand Down Expand Up @@ -139,6 +135,10 @@
<ROW File="XBatteryStatus.exeBadgeLogo.scale150.png" Component_="Store50x50Logo.scale100.png" FileName="XBATT~48.PNG|XBatteryStatus.exeBadgeLogo.scale-150.png" Attributes="0" SourcePath="Generated Assets\XBatteryStatus.exeBadgeLogo.scale-150.png" SelfReg="false"/>
<ROW File="XBatteryStatus.exeBadgeLogo.scale200.png" Component_="Store50x50Logo.scale100.png" FileName="XBATT~49.PNG|XBatteryStatus.exeBadgeLogo.scale-200.png" Attributes="0" SourcePath="Generated Assets\XBatteryStatus.exeBadgeLogo.scale-200.png" SelfReg="false"/>
<ROW File="XBatteryStatus.exeBadgeLogo.scale400.png" Component_="Store50x50Logo.scale100.png" FileName="XBATT~50.PNG|XBatteryStatus.exeBadgeLogo.scale-400.png" Attributes="0" SourcePath="Generated Assets\XBatteryStatus.exeBadgeLogo.scale-400.png" SelfReg="false"/>
<ROW File="Microsoft.Toolkit.Uwp.Notifications.dll" Component_="Microsoft.Toolkit.Uwp.Notifications.dll" FileName="MICROS~1.DLL|Microsoft.Toolkit.Uwp.Notifications.dll" Attributes="0" SourcePath="..\XBatteryStatus\bin\x64\Release\net5.0-windows10.0.19041.0\Microsoft.Toolkit.Uwp.Notifications.dll" SelfReg="false"/>
<ROW File="Microsoft.Windows.SDK.NET.dll" Component_="Microsoft.Windows.SDK.NET.dll" FileName="MICROS~2.DLL|Microsoft.Windows.SDK.NET.dll" Attributes="0" SourcePath="..\XBatteryStatus\bin\x64\Release\net5.0-windows10.0.19041.0\Microsoft.Windows.SDK.NET.dll" SelfReg="false"/>
<ROW File="Octokit.dll" Component_="Octokit.dll" FileName="Octokit.dll" Attributes="0" SourcePath="..\XBatteryStatus\bin\x64\Release\net5.0-windows10.0.19041.0\Octokit.dll" SelfReg="false"/>
<ROW File="WinRT.Runtime.dll" Component_="WinRT.Runtime.dll" FileName="WINRTR~1.DLL|WinRT.Runtime.dll" Attributes="0" SourcePath="..\XBatteryStatus\bin\x64\Release\net5.0-windows10.0.19041.0\WinRT.Runtime.dll" SelfReg="false"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.AppXCfgComponent">
<ROW ID="Configuration" Order="1" ManifestFile="AppxManifest.xml" TargetOs="4" AutoUpdatesFrequency="0" AutoUpdatesOptions="0" ManifestBundleFile="AppxBundleManifest.xml"/>
Expand Down Expand Up @@ -231,7 +231,7 @@
<ROW XmlAttribute="Square44x44Logo" XmlElement="VisualElements" Name="Square44x44Logo" Flags="0" Order="0" FileId="XBatteryStatus.exeSquare44x44Logo.scale100.png"/>
<ROW XmlAttribute="Square71x71Logo" XmlElement="DefaultTile" Name="Square71x71Logo" Flags="0" Order="0" FileId="XBatteryStatus.exeSquare71x71Logo.scale100.png"/>
<ROW XmlAttribute="TaskId" XmlElement="StartupTask" Name="TaskId" Flags="0" Order="0" Value="XBatteryStatus.exe"/>
<ROW XmlAttribute="Version" XmlElement="Identity" Name="Version" Flags="0" Order="0" Value="1.3.1.0"/>
<ROW XmlAttribute="Version" XmlElement="Identity" Name="Version" Flags="0" Order="0" Value="1.3.2.0"/>
<ROW XmlAttribute="Version_1" XmlElement="AppInstallerUX" Name="Version" Flags="0" Order="0" Value="1.0.0"/>
<ROW XmlAttribute="Wide310x150Logo" XmlElement="DefaultTile" Name="Wide310x150Logo" Flags="0" Order="0" FileId="XBatteryStatus.exeWide310x150Logo.scale100.png"/>
<ROW XmlAttribute="xmlns" XmlElement="AppInstallerUX" Name="xmlns" Flags="0" Order="0" Value="http://schemas.microsoft.com/msix/appinstallerux"/>
Expand Down Expand Up @@ -375,12 +375,12 @@
<ROW Feature_="MainFeature" Component_="XBatteryStatus.dll.config"/>
<ROW Feature_="MainFeature" Component_="XBatteryStatus.dll"/>
<ROW Feature_="MainFeature" Component_="Microsoft.Toolkit.Uwp.Notifications.dll"/>
<ROW Feature_="MainFeature" Component_="Microsoft.Windows.SDK.NET.dll"/>
<ROW Feature_="MainFeature" Component_="Octokit.dll"/>
<ROW Feature_="MainFeature" Component_="WinRT.Runtime.dll"/>
<ROW Feature_="MainFeature" Component_="SHORTCUTDIR"/>
<ROW Feature_="MainFeature" Component_="Microsoft.Windows.SDK.NET.dll"/>
<ROW Feature_="AiAppXAssets" Component_="Store50x50Logo.scale100.png"/>
<ROW Feature_="A9DBE469DEED46998DA553406739ED74" Component_="A9DBE469DEED46998DA553406739ED74"/>
<ROW Feature_="MainFeature" Component_="Octokit.dll"/>
<ROW Feature_="MainFeature" Component_="WinRT.Runtime.dll"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiIconsComponent">
<ROW Name="icon.exe" SourcePath="..\Icons\ico\icon.ico" Index="0"/>
Expand Down
19 changes: 13 additions & 6 deletions XBatteryStatus/MyApplicationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace XBatteryStatus
{
public class MyApplicationContext : ApplicationContext
{
private string version = "V1.3.1";
private string version = "V1.3.2";
private string releaseUrl = @"https://github.com/tommaier123/XBatteryStatus/releases";

NotifyIcon notifyIcon = new NotifyIcon();
Expand Down Expand Up @@ -103,24 +103,31 @@ public MyApplicationContext()
ToastArguments args = ToastArguments.Parse(toastArgs.Argument);
ValueSet userInput = toastArgs.UserInput;

if(args.ToString() == "action=update")
if (args.ToString() == "action=update")
{
ToastNotificationManagerCompat.Uninstall();
ToastNotificationManagerCompat.History.Clear();

if (File.Exists("XBatteryStatus.msi"))
string path = Path.Combine(Path.GetTempPath(), "XBatteryStatus", "XBatteryStatus.msi");

if(!Directory.Exists(Path.GetDirectoryName(path)))
{
Directory.CreateDirectory(Path.GetDirectoryName(path));
}

if (File.Exists(path))
{
File.Delete("XBatteryStatus.msi");
File.Delete(path);
}

using (var client = new WebClient())
{
client.DownloadFile(latest.Assets.Where(x=>x.BrowserDownloadUrl.EndsWith(".msi")).First().BrowserDownloadUrl, "XBatteryStatus.msi");
client.DownloadFile(latest.Assets.Where(x => x.BrowserDownloadUrl.EndsWith(".msi")).First().BrowserDownloadUrl, path);
}

Process process = new Process();
process.StartInfo.FileName = "msiexec";
process.StartInfo.Arguments = " /i XBatteryStatus.msi /qr";
process.StartInfo.Arguments = " /i " + path + " /qr";
process.StartInfo.Verb = "runas";
process.Start();

Expand Down

0 comments on commit dfe37ac

Please sign in to comment.