native exe, UninstallString without quotes
application is hosted under native registry hive

This method applies to PDFCreator, DAEMON Tools

silent-install.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set n=PDFCreator
setlocal EnableDelayedExpansion

:detect64
if "%ProgramFiles(x86)%"=="" goto native

:x64
reg query "%sw%\Wow6432Node\%u%" /s | find "%n%"
if !errorlevel!==0 goto exist

:native
reg query "%sw%\%u%" /s | find "%n%"
if !errorlevel!==0 goto exist

:install

for /f "tokens=*" %%a in ('dir /b "%~dp0PDFCreator*Setup.exe"') do (
echo %n%
start /wait "" "%~dp0%%a" /ForceInstall /VERYSILENT /LANG=English /COMPONENTS="program,ghostscript" /NORESTART
)

:exist
endlocal
silent-uninstall.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k={0001B4FD-9EA3-4D90-A79E-FD14BA3AB01D}
for /f "tokens=*" %%a in ('^
reg query "%sw%\%u%\%k%" /v UninstallString ^|
find "UninstallString"') do set "str=%%a"
set "first=%str:    REG_SZ    =" & set "UninstallString=%"
start /wait "" "%UninstallString%" /VERYSILENT /norestart
Check out more from  

2 comments

Click here for comments