Skip to content

Instantly share code, notes, and snippets.

@cosote
Created November 1, 2015 16:50
Show Gist options
  • Select an option

  • Save cosote/33a5a218191028c81036 to your computer and use it in GitHub Desktop.

Select an option

Save cosote/33a5a218191028c81036 to your computer and use it in GitHub Desktop.
Batch file for Windows Server OS (using Application Verifier) to enable/disable HighVersionLie of workstation. Useful to get application installer to install when prohibited on Windows Server editions.
@echo off
setlocal enabledelayedexpansion
echo %~nx0 enables or disables HighVersionLie for msiexec.exe
echo.
:: check if Application Verifier is installed
appverif -cppath 1>nul 2>nul
if errorlevel 255 goto :install_appverif
call :state
echo Application Verifier is !state! for msiexec.exe
echo.
if "!state!" equ "disabled" call :enable
if "!state!" equ "enabled" call :disable
appverif -query HighVersionLie -for msiexec.exe
echo.
pause
exit /b
:state
appverif -query HighVersionLie -for msiexec.exe|find "Product type = 1" 1>nul 2>nul
set "state=enabled"
if errorlevel 1 set "state=disabled"
exit /b
:enable
echo Enable HighVersionLie Product type=1 for msiexec.exe
appverif -enable HighVersionLie -for msiexec.exe -with "Product type"=1 1>nul
exit /b
:disable
echo Disable Application Verifier for msiexec.exe
appverif -delete settings -for msiexec.exe 1>nul
exit /b
:install_appverif
echo Application Verifier is not installed.
echo Please install, link: http://www.microsoft.com/en-us/download/details.aspx?id=20028
echo.
echo Download link is now opened in default browser...
pause
start "Download Application Verifier" "http://www.microsoft.com/en-us/download/details.aspx?id=20028"
exit /b
:help
echo Some error occurred.
echo Please check this tool.
echo.
echo Many free applications don't support installation on Windows Server OS.
echo Use this tool to enable and disable Application Verifier for msiexec.exe
echo reporting a Workstation OS.
echo.
pause
exit /b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment