Skip to content

Commit

Permalink
1.9.19
Browse files Browse the repository at this point in the history
[Bug fixes]
- UWP cannot be found after update
  • Loading branch information
Codectory committed Feb 18, 2022
1 parent e4f3796 commit 3881885
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="ProjectLocales.de.Designer.cs">
<DependentUpon>ProjectLocales.de.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="ProjectLocales.Designer.cs">
<DependentUpon>ProjectLocales.resx</DependentUpon>
<AutoGen>True</AutoGen>
Expand All @@ -84,10 +79,7 @@
<LastGenOutput>Locale_Enums.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ProjectLocales.de.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>ProjectLocales.de.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="ProjectLocales.de.resx" />
<EmbeddedResource Include="ProjectLocales.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>ProjectLocales.Designer.cs</LastGenOutput>
Expand Down
Empty file.
37 changes: 37 additions & 0 deletions Source/AutoActions.Setup/AutoActions.Setup.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>30b814f3-b6dd-42c6-bc50-e06a54cb6c51</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>AutoActions.Setup</OutputName>
<OutputType>Package</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="Product.wxs" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
30 changes: 30 additions & 0 deletions Source/AutoActions.Setup/Product.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="AutoActions.Setup" Language="1033" Version="1.0.0.0" Manufacturer="" UpgradeCode="c76ecc9c-3eef-40f4-81b2-4ad031bcec23">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />

<Feature Id="ProductFeature" Title="AutoActions.Setup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="AutoActions.Setup" />
</Directory>
</Directory>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent"> -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
</ComponentGroup>
</Fragment>
</Wix>
8 changes: 8 additions & 0 deletions Source/AutoActions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoActions.Audio", "AutoAc
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoActions.Updater", "AutoActions.Updater\AutoActions.Updater.csproj", "{5DF058E2-C5AB-42DE-8EED-D22FF39960AD}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "AutoActions.Setup", "AutoActions.Setup\AutoActions.Setup.wixproj", "{30B814F3-B6DD-42C6-BC50-E06A54CB6C51}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -81,6 +83,12 @@ Global
{5DF058E2-C5AB-42DE-8EED-D22FF39960AD}.Release|x64.Build.0 = Release|x64
{5DF058E2-C5AB-42DE-8EED-D22FF39960AD}.Release|x86.ActiveCfg = Release|x86
{5DF058E2-C5AB-42DE-8EED-D22FF39960AD}.Release|x86.Build.0 = Release|x86
{30B814F3-B6DD-42C6-BC50-E06A54CB6C51}.Debug|x64.ActiveCfg = Debug|x86
{30B814F3-B6DD-42C6-BC50-E06A54CB6C51}.Debug|x86.ActiveCfg = Debug|x86
{30B814F3-B6DD-42C6-BC50-E06A54CB6C51}.Debug|x86.Build.0 = Debug|x86
{30B814F3-B6DD-42C6-BC50-E06A54CB6C51}.Release|x64.ActiveCfg = Release|x86
{30B814F3-B6DD-42C6-BC50-E06A54CB6C51}.Release|x86.ActiveCfg = Release|x86
{30B814F3-B6DD-42C6-BC50-E06A54CB6C51}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
14 changes: 5 additions & 9 deletions Source/AutoActions/Applications/ApplicationItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public string UWPApplicationID {
public string UWPIconPath {
get => _uwpIconPath;
set { _uwpIconPath = value; try { if (IsUWP ||IsUWPWepApp) Icon = new Bitmap(Bitmap.FromFile(value)); } catch { }OnPropertyChanged(); } }


[JsonProperty(Order = 0)]
public string UWPIdentity { get => _uwpIdentity; set { _uwpIdentity = value; OnPropertyChanged(); } }

private ApplicationItem()
Expand All @@ -92,23 +93,19 @@ public ApplicationItem(UWPApp uwpApp) : this(uwpApp.Name, uwpApp.ExecutablePath)
IsUWPWepApp = true;
UWPFamilyPackageName = uwpApp.FamilyPackageName;
_uwpFullPackageName = uwpApp.FullPackageName;
_uwpApplicationID = uwpApp.ApplicationID;
UWPIconPath = uwpApp.IconPath;
UWPApplicationID = uwpApp.ApplicationID;
UWPIdentity = uwpApp.Identity;
}

private void LoadUWPData()
private void LoadUWPData()
{
string packageNotFound = "[PackageNotFound]_";

if (!IsUWP && !IsUWPWepApp)
return;
UWPApp uwpApp;
//Compatibility for old UWP handling
if (string.IsNullOrEmpty(UWPFullPackageName))
uwpApp = UWPAppsManager.GetUWPApp(UWPFamilyPackageName, UWPApplicationID);
else
uwpApp = UWPAppsManager.GetUWPApp(UWPFullPackageName);
uwpApp = UWPAppsManager.GetUWPApp(UWPFamilyPackageName, UWPIdentity);
if (uwpApp == null)
{
if (PackageError)
Expand All @@ -124,7 +121,6 @@ private void LoadUWPData()
DisplayName = DisplayName.Substring(packageNotFound.Length, DisplayName.Length - packageNotFound.Length);
UWPFamilyPackageName = uwpApp.FamilyPackageName;
_uwpFullPackageName = uwpApp.FullPackageName;
_uwpApplicationID = uwpApp.ApplicationID;
UWPIconPath = uwpApp.IconPath;
UWPIdentity = uwpApp.Identity;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/AutoActions/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.9.18.0")]
[assembly: AssemblyFileVersion("1.9.18.0")]
[assembly: AssemblyVersion("1.9.19.0")]
[assembly: AssemblyFileVersion("1.9.19.0")]
5 changes: 4 additions & 1 deletion Source/AutoActions/UWP/UWPApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public string ExecutablePath
public string FullPackageName { get; private set; } = string.Empty;

public string ApplicationID { get; private set; } = string.Empty;

public string Identity { get; private set; } = string.Empty;
public string IconPath { get; private set; } = string.Empty;

Expand Down Expand Up @@ -71,7 +72,8 @@ private void ReadAppxManifest(Package package)
{
XmlSerializer serializer = new XmlSerializer(typeof(AppxManifest));
AppxManifest appxManifest = (AppxManifest)serializer.Deserialize(reader);
Name = ((XmlNode[])appxManifest.Properties.DisplayName)[0].Value;
Name = package.DisplayName;
//Name = ((XmlNode[])appxManifest.Properties.DisplayName)[0].Value;
if (Name.Contains("ms-resource:"))
{
Name = GetNameOfStrangeMicrosoftAppxManifest(appxManifest);
Expand All @@ -83,6 +85,7 @@ private void ReadAppxManifest(Package package)
IsWebApp = true;
FamilyPackageName = package.Id.FamilyName;
FullPackageName = package.Id.FullName;
var a = package.Id.ResourceId;
ApplicationID = appxManifest.Applications?.Application.Id;
Identity = appxManifest.Identity.Name;
IconPath = GetIconPath(Path.Combine(InstallLocation, ((XmlNode[])(appxManifest.Properties.Logo))[0].Value));
Expand Down
10 changes: 5 additions & 5 deletions Source/AutoActions/UWP/UWPAppsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ public static class UWPAppsManager
private const string xboxPassAppFN = "Microsoft.GamingApp_8wekyb3d8bbwe";


public static UWPApp GetUWPApp(string packageNameOrFamilyPackageName, string applicationID = "")
public static UWPApp GetUWPApp(string packageNameOrFamilyPackageName, string identity = "")
{
var package = manager.FindPackageForUser(WindowsIdentity.GetCurrent().User.Value, packageNameOrFamilyPackageName);
if (package == null)
return GetUWPAppCompatible(packageNameOrFamilyPackageName, applicationID);
return GetUWPAppCompatible(packageNameOrFamilyPackageName, identity);
return new UWPApp(package);
}

private static UWPApp GetUWPAppCompatible(string familyPackageName, string applicationID)
private static UWPApp GetUWPAppCompatible(string familyPackageName, string identity)
{
foreach (var package in manager.FindPackagesForUser(WindowsIdentity.GetCurrent().User.Value))
{
try
{
UWPApp uwpApp = new UWPApp(package);
if (uwpApp.FamilyPackageName.Equals(familyPackageName) && uwpApp.ApplicationID.Equals(applicationID))
if (uwpApp.FamilyPackageName.Equals(familyPackageName) && (string.IsNullOrEmpty(identity) || uwpApp.Identity.Equals(identity)))
return uwpApp;
}
catch {}
Expand Down Expand Up @@ -78,7 +78,7 @@ public static List<ApplicationItem> GetUWPApps()
{
UWPApp uwpApp = new UWPApp(package);
if (!string.IsNullOrEmpty(uwpApp.ApplicationID))
uwpApps.Add(new ApplicationItem(uwpApp));
uwpApps.Add(new ApplicationItem(uwpApp));
}
catch
{
Expand Down
4 changes: 3 additions & 1 deletion Source/AutoActions/Views/AutoActionsLogsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
<Image Grid.Row="0" Grid.ColumnSpan="3" Source="{Binding Converter={StaticResource BitmapToBitmapImageConverter}, Source={x:Static pres:ProjectLocales.Logo}}" />
</Grid>
<Border Style="{StaticResource DefaultBorder}" Grid.Row="2" Margin="5" />
<ItemsControl Grid.Row="2" ItemsSource="{Binding Entries}" ItemTemplate="{StaticResource LogEntryTemplate }" Margin="15" BorderBrush="{x:Null}" BorderThickness="0" />
<ScrollViewer Grid.Row="2" Margin="15">
<ItemsControl ItemsSource="{Binding Entries}" ItemTemplate="{StaticResource LogEntryTemplate }" Margin="5" BorderBrush="{x:Null}" BorderThickness="0" />
</ScrollViewer>



Expand Down

0 comments on commit 3881885

Please sign in to comment.