Pkey-config is useless. People backed it up to frankenbuild and believe its needed for RTM. They replaced RTM with BETA to use beta key. pkey-config is same for all RTM office and never changes. Restore is likely to fail after reformat/reinstall for some reason.
Perhaps someone could help me solve a quick problem. Here's a if statement that is not working. if (Common.ExcelRetailLicenseInstalled == true && (Common.ExcelRetailLicType.Contains("Trial") || Common.ExcelRetailLicType.Contains("Subscription") || (Common.ExcelRetailLicType.Contains("Retail") && Common.ExcelRetailLicStatus != "Activated"))); Always ends up true (and VS says possible mistaken empty statement). What it does is a function previously got license details. A retail app can be Bypass (which we ignore and leave alone since its guaranteed activated. Trial, subscription, or Retail (MSDN or otherwise). Trial/Subscription can be marked as Activated (This means Licensed, as in not Rearm or Notifications, even though trial = 60 days). We get rid of it period. Retail if activated is activated forever so we don't want to uninstall it. The if statement needs to tell the first variable is true, if not, do not do the if statement. If true, check the license status. It will either contain the text, "subscription, retail, or trial" If subscription or trial, if is true, if retail, check if activated, if activated, then remove, not activated means if statement is false. This is used by EZ-Activator to decide whether or not to remove retail keys. Since this statement is messed up its giving true and attempting to remove retail keys indiscriminately and even if that retail product is not installed. EDIT: I'd like to do it in one if statement, as there are like 20 of these, so nested ifs or elses really add up. I was doing the Trial, Sub, or retail check as a nested if under License installed, with the remove key call there 3 times.
Try this if (Common.ExcelRetailLicenseInstalled == true && (Common.ExcelRetailLicType.Contains("Trial") || Common.ExcelRetailLicType.Contains("Subscription") || Common.ExcelRetailLicType.Contains("Retail")) && Common.ExcelRetailLicStatus != "Activated"); You have made a small mistake of using OR on the last two statements.
How about this if (Common.ExcelRetailLicenseInstalled == true & (Common.ExcelRetailLicType.Contains("Trial") || Common.ExcelRetailLicType.Contains("Subscription") || Common.ExcelRetailLicType.Contains("Retail")) & Common.ExcelRetailLicStatus != "Activated"); By using logical AND (&&) if the first statement is true it will not check the next statement, but in bitwise AND (&) all the statements will be evaluated.
Try this code, let me know if it worked. if (Common.ExcelRetailLicenseInstalled == true && ((Common.ExcelRetailLicType.Contains("Trial") || Common.ExcelRetailLicType.Contains("Subscription")) || (Common.ExcelRetailLicType.Contains("Retail")) && Common.ExcelRetailLicStatus != "Activated"))); Here's what it does: The ExcelRetailLicenseInstalled has to be true AND ( ( If it contains "Trial" OR "Subscription" the if is executed ) OR ( If it contains "Retail" AND the RetailLicStatus is "Activated ) )
I think it's the other way around, you're describing the OR statement, the logical AND && evaluates left-to-right and stops evaluating if one of the statements is false.
Checking if its anything but Activated permanently. Trial is 60 activated and 30 days unactivated, subscription is something activated and 30 days unactivated. Retail key can be installed at 30 days and unactivated, or permanently activated. If the key is trial, immediately remove it. Same with subscription. If Retail non trial/subscription key, Only remove it if its not permanently activated (which I determine earlier just fine).
if (Common.ExcelRetailLicenseInstalled == true & (Common.ExcelRetailLicType.Contains("Trial") | Common.ExcelRetailLicType.Contains("Subscription")) || (Common.ExcelRetailLicType.Contains("Retail") & Common.ExcelRetailLicStatus != "Activated")); Hope the above works. So, trial or subscription should be removed whether it is activated or not and Retail should be removed only if not activated. Is Common.ExcelRetailLicenseInstalled bool type, if yes it is redundant to check '== true'
Is your scenario the following? string LicType = "Trial"; bool LicenseInstalled = true; string LicStatus = "Activated";
In my current scenario, trial, isinstalled, not activated. Checking activation should only come into play when LicType="Retail", otherwise get red of that key if trial or subscription without concern about whether its activated. Maybe one of the past examples worked but had the ; in it.
Try this if (Common.ExcelRetailLicenseInstalled & (Common.ExcelRetailLicType.Contains("Trial") | Common.ExcelRetailLicType.Contains("Subscription")) | (Common.ExcelRetailLicType.Contains("Retail") & Common.ExcelRetailLicStatus != "Activated"))