cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Automated uninstall of Creo 2.0 solved

jmikesell
16-Pearl

Automated uninstall of Creo 2.0 solved

This took enough time to figure out that i want to share it here and hopefully save other time. I wanted a batch file to uninstall Creo 2.0 and assosiated addon from client machines, sounds like an eay task right?

The Admin guide have details on this starting on 157. The instuctions for uninstalling addons (Creo view, quality agent, etc) work as expected. The problems are in the removal of Parametric, Simulate, Help. When you call the uninstall.exe from the batch it fires of a second process pimuninstall.exe to do the actuall removal. But the batch file continues as soon as uninstall.exe finsihes. This causes the next request for uninstall to fail becuase the first one (now running uder pimuninstall.exe) is not finshed. So you have to have the batch file wait for pimuninstall.exe to complete. Below is the batch script to do this, tested on Win7. The key waiting code is between :LOOP1 and :CONTINUE1

 

@echo off
:: Silent Uninstaller for Creo 2 M240
:: by Jeremy Mikesell 8/9/2017
SET INSTALL_LOG=\\server123\Teams\Public\ENG\PTC\Creo4.0\log\install_log.txt
ECHO %username% %computername% %date% %time% Uninstall Start Creo 2.0 M240 %NETWORK_INSTALL_APPS% >> "%INSTALL_LOG%"
ECHO %username% %computername% %date% %time% Uninstalling Addons Start >> "%INSTALL_LOG%"
echo Uninstalling Quality Agent
msiexec /uninstall "C:\ptc\Creo 2.0\Common Files\M240\install\addon\creoagent_32_64.msi" /passive
echo Uninstalling Thumbnail Viewer
msiexec /uninstall "C:\ptc\Creo 2.0\Common Files\M240\install\addon\Thumbviewer_32_64.msi" /passive
echo Uninstalling CreoView Express
msiexec /uninstall "C:\ptc\Creo 2.0\Common Files\M240\install\addon\pvx32_64\pvexpress\CreoView_Express_32_64.msi" /qn
ECHO %username% %computername% %date% %time% Uninstalling Addons Finish >> "%INSTALL_LOG%"
echo Uninstalling Parametric
ECHO %username% %computername% %date% %time% Uninstalling Parametric Start >> "%INSTALL_LOG%"
"C:\ptc\Creo 2.0\Parametric\bin\uninstall.exe" -quiet
:LOOP1
Timeout /T 10 /Nobreak
tasklist | find /i "pimuninstall" >nul 2>&1
IF ERRORLEVEL 1 (
  GOTO CONTINUE1
) ELSE (
  ECHO Uninstall is still running
  Timeout /T 10 /Nobreak
  GOTO LOOP1
)
:CONTINUE1
ECHO %username% %computername% %date% %time% Uninstalling Parametric Finish >> "%INSTALL_LOG%"
echo Uninstalling Mechanica
ECHO %username% %computername% %date% %time% Uninstalling Simulation Start >> "%INSTALL_LOG%"
"C:\ptc\Creo 2.0\Simulate\bin\uninstall.exe" -quiet
:LOOP2
Timeout /T 10 /Nobreak
tasklist | find /i "pimuninstall" >nul 2>&1
IF ERRORLEVEL 1 (
  GOTO CONTINUE2
) ELSE (
  ECHO Uninstall is still running
  Timeout /T 10 /Nobreak
  GOTO LOOP2
)
:CONTINUE2
ECHO %username% %computername% %date% %time% Uninstalling Simulation Finish >> "%INSTALL_LOG%"
echo Uninstalling Help
ECHO %username% %computername% %date% %time% Uninstalling Help Start >> "%INSTALL_LOG%"
"C:\ptc\Creo 2.0\Help\bin\uninstall.exe" -quiet
:LOOP3
Timeout /T 10 /Nobreak
tasklist | find /i "pimuninstall" >nul 2>&1
IF ERRORLEVEL 1 (
  GOTO CONTINUE3
) ELSE (
  ECHO Uninstall is still running
  Timeout /T 10 /Nobreak
  GOTO LOOP3
)
:CONTINUE3
ECHO %username% %computername% %date% %time% Uninstalling Help Finish >> "%INSTALL_LOG%"
echo Removing Desktop Icons
del "C:\Users\%username%\Desktop\Creo Parametric 2.0.lnk"
del "C:\Users\%username%\Desktop\PTC Return.bat"
del "C:\Users\%username%\Desktop\ptcborrow.bat - Shortcut.lnk"
ECHO %username% %computername% %date% %time% Uninstall Finish >> "%INSTALL_LOG%"
pause
0 REPLIES 0
Announcements
NEW Creo+ Topics: PTC Control Center and Creo+ Portal


Top Tags