Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions LocalSystem/Msi/Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ public static class Api
private static extern Int32 MsiGetProductInfo(
string product,
string property,
[Out] String valueBuf,
StringBuilder valueBuf,
ref Int32 len);

[DllImport("msi.dll",
Expand Down Expand Up @@ -641,7 +641,7 @@ public static string GetComponentPathByFile(string fileName)
/// Get property of a product indicated by GUID. Throws exception if cannot read the property.
/// </summary>
/// <param name="productGUID">Product GUID</param>
/// <param name="PropertyName">Property name</param>
/// <param name="propertyName">Property name</param>
/// <returns>Property value, if available.</returns>
/// <exception cref="MSIException">Throws MSIException if reading property was not successful</exception>
public static String getProperty(string productGUID, string propertyName)
Expand All @@ -652,7 +652,7 @@ public static String getProperty(string productGUID, string propertyName)
// increase for the terminating \0
len++;

String r = new string(new char[len]);
var r = new StringBuilder();
int returnValue = Api.MsiGetProductInfo(productGUID, propertyName, r, ref len);
if (returnValue != 0)
{
Expand All @@ -661,7 +661,7 @@ public static String getProperty(string productGUID, string propertyName)
throw new MSIException(returnValue);
}
}
return r;
return r.ToString();
}
#endregion
}
Expand Down
15 changes: 0 additions & 15 deletions LocalSystem/Msi/MsiException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,5 @@ public MSIException(int returnValue)
public MSIException(string message, Exception innerException)
: base(message, innerException) { }

/// <summary>
/// Initializes a new instance of the <see cref="MSIException"/> class
/// when provided with the serialization information and streaming
/// context.
/// </summary>
/// <param name="info">
/// The serialization information.
/// </param>
/// <param name="context">
/// The streaming context.
/// </param>
protected MSIException(
SerializationInfo info,
StreamingContext context)
: base(info, context) { }
}
}
5 changes: 0 additions & 5 deletions LocalSystem/WindowsUserSidNotFound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,5 @@ public WindowsUserSidNotFound(
string message,
Exception innerException)
: base(message, innerException) { }

protected WindowsUserSidNotFound(
SerializationInfo info,
StreamingContext context)
: base(info, context) { }
}
}
4 changes: 0 additions & 4 deletions Plex/AppNotInstalledException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,5 @@ public AppNotInstalledException(
Exception innerException)
: base(message, innerException) { }

protected AppNotInstalledException(
SerializationInfo info,
StreamingContext context)
: base(info, context) { }
}
}
5 changes: 0 additions & 5 deletions Plex/PlexDataFolderNotFoundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,5 @@ public PlexDataFolderNotFoundException(
string message,
Exception innerException)
: base(message, innerException) { }

protected PlexDataFolderNotFoundException(
SerializationInfo info,
StreamingContext context)
: base(info, context) { }
}
}
5 changes: 0 additions & 5 deletions Plex/ServiceNotInstalledException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,5 @@ public ServiceNotInstalledException(
string message,
Exception innerException)
: base(message, innerException) { }

protected ServiceNotInstalledException(
SerializationInfo info,
StreamingContext context)
: base(info, context) { }
}
}
4 changes: 2 additions & 2 deletions Plex/SilentUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class SilentUpdate
/// <summary>
/// The wait timer.
/// </summary>
private Timer _timer = null;
private System.Timers.Timer _timer = null;
#endregion

#region Properties
Expand Down Expand Up @@ -199,7 +199,7 @@ private void Initialize(string logPath)
try
{
_server = new MediaServer(logPath, ServerUpdateMessage);
_timer = new Timer(DefaultWaitTime * 1000);
_timer = new System.Timers.Timer(DefaultWaitTime * 1000);
_timer.Elapsed += OnTimedEvent;
_timer.Enabled = false;
}
Expand Down
21 changes: 21 additions & 0 deletions PlexServerAutoUpdater-net10.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net10.0-windows</TargetFramework>
<RootNamespace>PlexServerAutoUpdater</RootNamespace>
<Nullable>disable</Nullable>
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't fancy going through all the warnings so just kept the most compatible setting.

<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyTitle>Plex Service Auto Updater</AssemblyTitle>
<AssemblyVersion>0.3.0.0</AssemblyVersion>
<FileVersion>0.3.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="System.Management" Version="10.0.0" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="10.0.0" />
</ItemGroup>

</Project>
23 changes: 15 additions & 8 deletions PlexServerAutoUpdater.sln
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 5.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlexServerAutoUpdater", "PlexServerAutoUpdater.csproj", "{5E327EE8-620A-4945-81CE-029CE9448171}"
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18
VisualStudioVersion = 18.3.11206.111
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlexServerAutoUpdater-net10", "PlexServerAutoUpdater-net10.csproj", "{C0DA8A85-CCC6-A879-0926-9A3280D319EB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5E327EE8-620A-4945-81CE-029CE9448171}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E327EE8-620A-4945-81CE-029CE9448171}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E327EE8-620A-4945-81CE-029CE9448171}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5E327EE8-620A-4945-81CE-029CE9448171}.Release|Any CPU.Build.0 = Release|Any CPU
{C0DA8A85-CCC6-A879-0926-9A3280D319EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C0DA8A85-CCC6-A879-0926-9A3280D319EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C0DA8A85-CCC6-A879-0926-9A3280D319EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C0DA8A85-CCC6-A879-0926-9A3280D319EB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {234DC311-F4B2-495A-B034-B09F513121C7}
EndGlobalSection
EndGlobal
29 changes: 0 additions & 29 deletions Properties/AssemblyInfo.cs

This file was deleted.