PDA

View Full Version : Repackager - How to change "Automated Tests" rules that are evaluated?



AaronTan
04-29-2015, 06:46 PM
In the AdminStudio Repackager when you edit a Repackager project and go to Repackaged Output -> Create Microsoft Windows Installer package, there is another setting called "Run Automated Tests on the package".

10818

After you build the MSI package from the Repackager, an XML file is generated which logs the automated tests and fixes applied during the build process. One of tests adds a MsiSystemRebootPending <> "1" to the LaunchCondition table, as you can see in an excerpt of this log:


<TestCase name="Reboot Pending Launch Condition" category="Windows Vista Restart Manager" class="VistaTest.ProgramTest" selected="true">
<TestResults>
<TestResult ordinal="1" severity="Warning" state="Resolved" type="Automatic">A Launch Condition was created that checks for a pending reboot before allowing an install to continue.<TestData><Msg>The installation will launch even in the event that a system restart is pending.</Msg><Resolution>VistaTest.Resolve.RebootPendingLaunchCondition</Resolution><ResDesc>A Launch Condition was created that checks for a pending reboot before allowing an install to continue.</ResDesc><ResolutionMsg>A Launch Condition was created that checks for a pending reboot before allowing an install to continue.</ResolutionMsg></TestData></TestResult>
</TestResults>
<TestData>
<Details>Tests to see if there exists a Launch Condition that will prevent the install from continuing when a restart is pending.</Details>
<KBArticle>TestHelpTopics\Reboot Pending Launch Condition.htm</KBArticle>
<NoResults>The 'Reboot Pending Launch Condition' test ran, but did not detect any problems as the 'MsiRMFilesInUse' dialog is present in the MSI.</NoResults>
<Perform>VistaTest.Perform.RebootPendingLaunchCondition</Perform>
<Resolution>VistaTest.Resolve.RebootPendingLaunchCondition</Resolution>
<Msg severity="Warning">The installation will launch even in the event that a system restart is pending.</Msg>
<ResDesc type="Automatic">A Launch Condition was created that checks for a pending reboot before allowing an install to continue.</ResDesc>
<ResolutionMsg>A Launch Condition was created that checks for a pending reboot before allowing an install to continue.</ResolutionMsg>
</TestData>
</TestCase>

How can I selectively disable this particular test from run without having to globally disable the "Run Automated Tests on the package" option? There is nothing mentioned about this in the AdminStudio help documentation.

i.e. Where does the Repackager obtain the master set of automated test rules from?

Interestingly enough, when you open the .ISM that's generated from the Repackager and then Build the MSI, the LaunchCondition is subsequently removed.

My preference would be for the Repackager to never put the LaunchCondition in, in the first place.

Alpesh
04-29-2015, 11:46 PM
Hi,

There should be a PackageExpert folder under the AS Installation directory. In that folder, you will find few xml files, which basically drive these automated tests. You will need to edit these xml files, so that the tests do not run during the build from Repackager.

If you need more help with this, please contact support.

Thanks!

AaronTan
04-30-2015, 12:44 AM
Hi,

There should be a PackageExpert folder under the AS Installation directory. In that folder, you will find few xml files, which basically drive these automated tests. You will need to edit these xml files, so that the tests do not run during the build from Repackager.

If you need more help with this, please contact support.

Thanks!

Thanks for the quick response. Found it under C:\Program Files (x86)\AdminStudio\2013\PackageExpert\Windows7Test.xml

<TestCase name="Reboot Pending Launch Condition" category="Windows7 Restart Manager" class="VistaTest.ProgramTest" selected=response

Evan Border
04-30-2015, 12:48 AM
For anyone using AdminStudio 2014, PackageExpert was removed in that version (but the "Run Automated Tests on the Package" checkbox is still seen in Repackager, though it's grayed-out).

For those using AdminStudio 2013 R2 or earlier, there are two .xml files that you'll want to edit:
%ProgramFiles(x86)%\AdminStudio\2013\PackageExpert\VistaTest.xml
%ProgramFiles(x86)%\AdminStudio\2013\PackageExpert\Windows7Test.xml

Open each of those .xml files and search for the line that begins with <TestCase name="Reboot Pending Launch Condition"

At the end of the line, change selected="true" to selected="false"

So in the Windows7Test.xml file, the line should now look like:
<TestCase name="Reboot Pending Launch Condition" category="Windows7 Restart Manager" class="VistaTest.ProgramTest" selected="false">

And in the VistaTest.xml file, the line should now look like:
<TestCase name="Reboot Pending Launch Condition" category="Windows Vista Restart Manager" class="VistaTest.ProgramTest" selected="false">

AaronTan
04-30-2015, 01:16 AM
For anyone using AdminStudio 2014, PackageExpert was removed in that version (but the "Run Automated Tests on the Package" checkbox is still seen in Repackager, though it's grayed-out).



Thanks Evan,

Is it grayed-out but still enabled? Or grayed-out and disabled?

Also, are you able to answer how and why InstallShield removes that same LaunchCondition on build? In AdminStudio 2013 Professional Complete, if you run it through the Test Center, the automated fix is to put the LaunchCondition back in!
Refer to page 1761 of the user guide
https://www.microway.com.au/installshield/AS2013UserGuide.pdf

Evan Border
04-30-2015, 05:25 AM
Thanks Evan,

Is it grayed-out but still enabled? Or grayed-out and disabled?

Also, are you able to answer how and why InstallShield removes that same LaunchCondition on build? In AdminStudio 2013 Professional Complete, if you run it through the Test Center, the automated fix is to put the LaunchCondition back in!
Refer to page 1761 of the user guide
https://www.microway.com.au/installshield/AS2013UserGuide.pdf

It's grayed-out and disabled:

10819

InstallShield does not actually remove the LaunchCondition on build. What you are seeing is a result of how PackageExpert operated. PackageExpert acted upon the .msi package, not the .ism project. You were using InstallShield to build the .ism (which at no point ever contained the LaunchCondition) and it produced a .msi package that also did not contain a LaunchCondition. So your newly built .msi (sans LaunchCondition) overwrote the PackageExpert-manipulated .msi which had the LaunchCondition.

Also: If you check the build log, you may see a message that states that PackageExpert was removed:

10820

You'll see this message if your Options.ini contains RunTests=Y under the [General] section:

10821

You can get rid of that message by changing RunTests=Y to RunTests=N. You'll want to make that change in the copy of Options.ini located at %ProgramFiles(x86)%\AdminStudio\201X\Repackager\Options.ini so that it's the default value.

AaronTan
04-30-2015, 07:05 AM
Ahh that would explain it! Thanks very much. Very enlightening.