Académique Documents
Professionnel Documents
Culture Documents
After installing use the script below to activate the product, dont forget to
create the Registration.XML as specified by the vendor.
The reason we are using this script to activate/deactivate is because the Nvivo.exe
always returns 0, even on activate/deactivate failure. This script pipes the output
to a variable and checks for success strings.
Please check the output of the activation output from Nvivo.exe, if the vendor
changes the string output, then this will fail to work.
<#
.SYNOPSIS
This will activate and deactivate Nvivio 11 with detection methods to ensure
the action has
been completed correctly.
.LINK
Author:.......http://www.linkedin.com/in/rileylim
.EXAMPLE
To activate Nvivo.
PowerShell.exe -ExecutionPolicy ByPass -File Manage-NvivoLicence.ps1
.EXAMPLE
To deactivate Nvivo.
PowerShell.exe -ExecutionPolicy ByPass -File Manage-NvivoLicence.ps1 -Remove
#>
Param([Switch]$Remove)
$DebugPreference = 'SilentlyContinue' #SilentlyContinue|Continue
$warningpreference = 'SilentlyContinue' #SilentlyContinue|Continue
$WaitTimer = 7 #In secounds, will wait until trying again
$MaxAttempts = 5 #Max tries until failing with error code 1
$Count = $null #If testing manually this will flash $Count
$Count = $null
Write-Debug 'Activating Nvivo.'
Do {$String = & $Nvivo -a Registration.xml | Out-String
$BreakOutA = $String.Contains('Your license has now been activated.')
$BreakOutB = $String.Contains('License key already activated.')
Write-Debug "Activating licence `$String value is: $String"
Write-Debug "Activating licence `$BreakOut value is: $BreakOut"
Start-Sleep $WaitTimer
$Count = $Count + 1
Write-Debug "The `$Counter vlue is: $Count"
If ($Count -eq $MaxAttempts)
{Write-Debug "The `$Count has reached `$MaxAttempts of
$MaxAttempts"
Write-Warning "Exiting with error code!"
Exit 1}}
Until($BreakOutA -or $BreakOutB -eq $true)
Exit 0}
Setup Information:
Setup Type: Windows Installer (MSI)
Deployment Method Used: Windows Installer Command Line (No MST)
Deployment Difficulty: Very Easy
Platform(s): Windows