Skip to content

Commit

Permalink
Fix: Updates failed for Apps with mutiple InstallTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
rzander committed Nov 2, 2019
1 parent d42cec6 commit a1e9001
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
23 changes: 19 additions & 4 deletions RZ.Base/RZUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,26 @@ public SWUpdate CheckForUpdate(string ProductName, string Version, string Manufa
if (string.IsNullOrEmpty(SW.PSPreReq))
SW.PSPreReq = "$true; ";

//Check PreReq for all Installation-types of the Software
if ((bool)SWUpdate._RunPS(SWCheck.PSPreReq)[0].BaseObject)
var pRes = SWUpdate._RunPS(SWCheck.PSPreReq);
if (pRes.Count > 0)
{
SoftwareUpdate = new SWUpdate(SWCheck);
return SoftwareUpdate;
try
{
//Check PreReq for all Installation-types of the Software
if ((bool)pRes[0].BaseObject)
{
SoftwareUpdate = new SWUpdate(SWCheck);
return SoftwareUpdate;
}
}
catch
{
continue;
}
}
else
{
continue;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion RZUpdate/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.1.*")]
[assembly: AssemblyFileVersion("1.7.1.1")]
[assembly: AssemblyFileVersion("1.7.1.2")]
2 changes: 1 addition & 1 deletion RZUpdateTest/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void TestMethodDownloadUpdate()
{
Console.WriteLine("Check Update for SCCMCliCtr 1.0.3.9...");
RZUpdater oRZSW = new RZUpdater();
var oUpdate = oRZSW.CheckForUpdate("Client Center for Configuration Manager", "1.0.3.9", "Zander Tools");
var oUpdate = oRZSW.CheckForUpdate("Adobe Acrobat Reader DC MUI", "19.021.20048", "Adobe Systems Incorporated");
Console.WriteLine("found Version:" + oRZSW.SoftwareUpdate.SW.ProductVersion);
Assert.IsNotNull(oUpdate, "Update detected successfully.");
Assert.IsNotNull(oUpdate.SW.ContentID, "Update conatins ContentID");
Expand Down

0 comments on commit a1e9001

Please sign in to comment.