Skip to content

Commit

Permalink
Fixed again ADMX Policy Template fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
UndertakerBen committed Aug 2, 2022
1 parent f6acb0f commit d5e399f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
18 changes: 10 additions & 8 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,17 @@ public Form1()
{
using (StreamReader reader = new StreamReader(response2.GetResponseStream()))
{
var text = reader.ReadToEnd().ToString().ToLower();
string[] splittext = text.Substring(text.IndexOf("{"product":"policy")).Replace("{"product":"policy", "|{"product":"policy").Replace(""", "\"").ToString().Split(new char[] { '|', '>' }, 3)[1].Replace("{\"releaseid", "|{\"releaseid").Split(new char[] { '|' });
string texting = reader.ReadToEnd();
string text = texting.ToLower().Replace(""", "\"");
reader.Close();
string[] splittext = text.Substring(text.IndexOf("\"product\": \"policy")).Replace("\"product\": \"policy", "|\"product\": \"policy").ToString().Split(new char[] { '|', '>' }, 3)[1].Replace("\"releaseid", "|\"releaseid").Split(new char[] { '|' });
for (int i = 0; i < splittext.GetLength(0); i++)
{
if (splittext[i].Contains("productversion") & splittext[i].Contains("artifactname\":\"zip\","))
if (splittext[i].Contains("productversion") & splittext[i].Contains("artifactname\": \"zip\","))
{
string productVersion = splittext[i].Substring(splittext[i].IndexOf("productversion\":\"")).Split(new char[] { '"' }, 4)[2];
string productVersion = splittext[i].Substring(splittext[i].IndexOf("productversion\": \"")).Split(new char[] { '"' }, 4)[2];
string productVShort = productVersion.Split(new char[] { '.' }, 2)[0];
string productURL = splittext[i].Substring(splittext[i].IndexOf("artifactname\":\"zip\",\"location\":")).Split(new char[] { '"' }, 8)[6];
string productURL = splittext[i].Substring(splittext[i].IndexOf("\"location\":")).Split(new char[] { '"' }, 5)[3];
if (policyVMenu != productVShort)
{
SubPVMenu = new ToolStripMenuItem(productVShort);
Expand Down Expand Up @@ -112,11 +114,11 @@ async void Download2_Click(object sender, EventArgs e)
policyVMenu = productVShort;

}
else if (splittext[i].Contains("productversion") & splittext[i].Contains("artifactname\":\"cab\","))
else if (splittext[i].Contains("productversion") & splittext[i].Contains("artifactname\": \"cab\","))
{
string productVersion = splittext[i].Substring(splittext[i].IndexOf("productversion\":\"")).Split(new char[] { '"' }, 4)[2];
string productVersion = splittext[i].Substring(splittext[i].IndexOf("productversion\": \"")).Split(new char[] { '"' }, 4)[2];
string productVShort = productVersion.Split(new char[] { '.' }, 2)[0];
string productURL = splittext[i].Substring(splittext[i].IndexOf("artifactname\":\"cab\",\"location\":")).Split(new char[] { '"' }, 8)[6];
string productURL = splittext[i].Substring(splittext[i].IndexOf("\"location\":")).Split(new char[] { '"' }, 5)[3];
if (policyVMenu != productVShort)
{
SubPVMenu = new ToolStripMenuItem(productVShort);
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
// 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.4.8.1")]
[assembly: AssemblyFileVersion("1.4.8.1")]
[assembly: AssemblyVersion("1.4.8.2")]
[assembly: AssemblyFileVersion("1.4.8.2")]
[assembly: NeutralResourcesLanguage("en")]
2 changes: 1 addition & 1 deletion Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.8.1
1.4.8.2

0 comments on commit d5e399f

Please sign in to comment.