Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
For Creo 3, our company batch file would uninstall each application one at a time, before doing an install for a new datecode. Each application was uninstalled separately for better support and flexibility with options.
For the Creo Agent, in Creo 3, we used the WMIC protocols to uninstall it. However, in Creo 4, that no longer works for the Platform Services, even though it is listed in WMIC.
Support suggests we use the new Install Manager batch file to uninstall everything at once. As I've said, I like the flexibility of doing it one at a time. I tried to even uninstall everything first and then wait to the end to use the Install Manager just for the Platform Services. However, when I do this, the Install Manager is removed, leaving the Platform Services still installed.
Does anyone have any inventive solutions to uninstall Platform Services on its own, using a batch command, besides using the Install Manager to uninstall everything at once?
Thanks in advance!
Solved! Go to Solution.
Everything you need to uninstall via a command line is in the registry. Open up regedit and then pick edit Find and what I do is type in something I think will be unique to Creo. So in the control panel from programs & features you see this:
I typed in datecode [f000] in the search field to get most of them.
My first hit was for Flexnet, what you want is the key that says UninstallString.
Every component should have one.
You’ll also want to do a search on the other items listed in the control panel.
To copy these commands out of the registry so you don’t have to retype them and possibly fat finger it, pick on the UninstallString key and pick Modify.
Hi-lite the value data field and RMB Copy.
Now you can paste that into notepad++ or whatever editor you use. like this:
"C:\Program Files\PTC\Creo 4.0\F000\InstallManager\uninstall.exe" -xmlPath "C:\Program Files\PTC\Creo 4.0\F000\Simulate\bin\pim\xml"
The advantage of using the uninstall string is it works much quicker than the WMIC commands.
If the untinsall string lists an msi you may want to add this to the end of the string. /qn REBOOT=ReallySuppress
For example:
Everything you need to uninstall via a command line is in the registry. Open up regedit and then pick edit Find and what I do is type in something I think will be unique to Creo. So in the control panel from programs & features you see this:
I typed in datecode [f000] in the search field to get most of them.
My first hit was for Flexnet, what you want is the key that says UninstallString.
Every component should have one.
You’ll also want to do a search on the other items listed in the control panel.
To copy these commands out of the registry so you don’t have to retype them and possibly fat finger it, pick on the UninstallString key and pick Modify.
Hi-lite the value data field and RMB Copy.
Now you can paste that into notepad++ or whatever editor you use. like this:
"C:\Program Files\PTC\Creo 4.0\F000\InstallManager\uninstall.exe" -xmlPath "C:\Program Files\PTC\Creo 4.0\F000\Simulate\bin\pim\xml"
The advantage of using the uninstall string is it works much quicker than the WMIC commands.
If the untinsall string lists an msi you may want to add this to the end of the string. /qn REBOOT=ReallySuppress
For example:
A couple of questions:
Thanks!
The uninstall string is the same for all machines, but it is unique to the version of the software installed. F000 will be different than M010.
Some will have two uninstall strings. For example the Platform Services has a weird name, and it has a QuietUninstallString and a UninstallString that will require user interaction.
unfortunately not every PTC product has a nice uninstall string. I typically have to use wmic for those.
Mathcad 15 I use this:
rem ** Uninstall any existing version of Mathcad 15
wmic product where (name like "%%Mathcad 15%%") call uninstall /nointeractive
Mathcad Prime I use this:
rem ** Uninstall any existing version of Mathcad Prime
wmic product where (name like "%%Mathcad Prime%%") call uninstall /nointeractive
Creoview I use this:
rem ** Kill running processes so the installer will not reboot the machine after the install.
tskill Acrobat
tskill AcroRd32
tskill pview
tskill productview
rem ** Remove all current versions of Creo View
wmic product where (name like "%%Creo View%%") call uninstall /nointeractive
Finished Editing last post. Thanks again.
You can use Olaf code snipet to check to see what's install and then just run the appropriate uninstall command.
rem ** Check and set current build
set CREOVERSION=Unknown
rem ** CREOVERSION will be set to the alphabetical latest folder
FOR /F %%i IN ('dir /AD /B /ON "%CreoPath%\F*" "%CreoPath%\M*"') DO (set CREOVERSION=%%i)
rem ** Error message if no build folder has been found
IF NOT EXIST "%CreoPath%\%CREOVERSION%\Common Files" echo ERROR: No valid Creo 3.0 build found in %CreoPath% (%CREOVERSION%)
I only use the WMIC where I couldn't use the silent method dictated in the documentation ("%creo_load_point%\%Installed_Date_Code%\Simulate\bin\uninstall.lnk" ). Based on what you've said above, I've found the below MsiExec for the programs I've used WMIC:
Creo View 4.0 - MsiExec.exe /I{319DF626-D04C-4CF6-B4F7-27080294A4A0}
MathCAD Prime 4.0 - MsiExec.exe /X{76F154D2-2092-41FC-956C-DC0B79D2B8CA}
Creo View Express 4.0 - MsiExec.exe /X{C71E9025-8D0D-4AA6-8F55-23D0ED20392E}
Thumbnail Viewer 4.0 - MsiExec.exe /X{7B71C02C-89C9-462C-8F95-11D13F9A5842}
Diagnostic Tools 4.0 - MsiExec.exe /X{F35B2487-77CD-4A91-A83C-DD64D7D5C663}
MKS Platform Components 9.X - MsiExec.exe /I{30276636-0000-0905-9ABB-000BDB5CF35D}
Platform Services - MsiExec.exe /X{5245CF2D-235F-4794-A2EE-C23E3261CC5F}
For the above, it sounds like you would still use the WMIC for better control. Is that correct? I guess I would only need the Platform Services for my initial query.
The uninstall string is faster. I use it where it exist. If there isn't an uninstall string I try to use wmic. If that fails I use EMCO MSI Builder to create an msi to do the uninstall.
Thanks for your help.
I'm just updating our silent install script to Creo 4.0.
The uninstallation with the InstallManager seems quiet unstable. It would be really nice if we could add Creo Help XML Files too. Then it would be a real "one-liner".
The InstallManager returns immediately. How you check if it's finished to remove the rest of the files?
I'd recommend you to switch to powershell (for new scripts).
To get all installed MSIs and there Codes:
get-wmiobject -Class win32_product | ft -wrap -autosize > msi.txt
uninstall with:
msiexec.exe /x {MSI-CODE} /qn /norestart /l*v c:\logs\log.txt
to remove all Creo View Versions:
$creoViewInstallations = get-wmiobject -Class win32_product -Filter "Name like '%PTC Creo View%'" foreach ($inst in $creoViewInstallations) { $inst.uninstall() if ($inst.uninstall().returnvalue -eq 0) { Write-Output "Successfully uninstalled $($inst.name)." } else { Write-Output "Failed to uninstall $($inst.name)." } }
I ran into the same issue with msiexec uninstall commands. Here's my solution for all methods:
MSIEXEC Uninstall String
To make the msiexec.exe process wait until it’s finished, you can’t test if the process is running, because Windows leave the process in a running state after it’s finished.
To make it wait, we have to add two things to the command line.
When the uninstall is complete, the spawned process dies and at that point the batch script resumes processing commands.
Syntax looks like this:
Just adding the start /wait to the beginning of the command makes this happen.
WMIC Uninstall String
After starting the uninstall using wmic, we monitor the task list for wmic. If it’s in the list we wait for 5 seconds and then check again.
When the process is no longer in the list, we go to the next section of the script.
Syntax looks like this
PTC’s Uninstall.exe
Newer versions of Creo Parametric contain uninstall executables for various components of the software. They are located here:
Obviously your loadpoint path may be different than mine.
When this Uninstall.exe runs it generates a process in the task list named, pmiuninstall.exe.
That is the process we look for in the script.
Syntax looks like this
Hi,
in the meantime, I discovered that querying
get-wmiobject -Class win32_product
can have bad side effects if some installations are broken. e.g. https://blogs.technet.microsoft.com/askds/2012/04/19/how-to-not-use-win32_product-in-group-policy-filtering/
if you are using SCCM you can use:
# will uninstall all products containing 'Creo View' in the product name.
$creoViewInstallations = get-wmiobject -Namespace 'root\cimv2\sms' -Class "Sms_InstalledSoftware" | Where {$_.ProductName -match 'Creo View'} $process = "msiexec.exe" foreach ($inst in $creoViewInstallations) { $arguments = "/x`"$($inst.SoftwareCode)`" /norestart /qn" $processReturn = Start-Process $process -Argumentlist $arguments -NoNewWindow -Passthru -Wait }
it's even faster.
br Bernhard
One more idea here.
We use LANDesk to let the users self deploy the software. LANDesk will run the install as local system, and then it can run a post install script as the user that deployed the software.
I use that second script run as the user to configure the software for that user and to record the user, machine, and date that the software was deployed.
Here are the last few lines of the post install script:
rem ** Record Computer & User info, and open a message to user
call "\\<servername>\<sharename>\<path>\record_computer_Creo3-110.cmd"
EXIT /B 0
The record computer batch file looks like this:
rem ********* Add to Log File: results, Machine, User, OS bitness, date, & time ***********
rem ** do a wmi query to get the computer model set it to the "machine" variable
FOR /F "tokens=2 delims==" %%A IN ('WMIC csproduct GET Name /VALUE ^| FIND /I "Name="') DO SET machine=%%A
for /F "tokens=*" %%n in ('wmic PATH Win32_videocontroller GET description ^| findstr "NVIDIA AMD"') do set GPU_NAME=%%n
FOR /F "tokens=2 delims==" %%A IN ('WMIC cpu GET Name /VALUE ^| FIND /I "Name="') DO SET machinecpu=%%A
rem ** Check and set current build
set CREOVERSION=Unknown
rem ** CREOVERSION will be set to the alphabetical latest folder
FOR /F %%i IN ('dir /AD /B /ON "%CREO3PATH%\F*" "%CREO3PATH%\M*"') DO (set CREOVERSION=%%i)
rem ** Check for 64bit OS
if exist C:\Windows\SysWOW64 (Set bitness=64_Bit) ELSE (Set bitness=32_Bit)
if exist d:\ptc (Set DriveSetUp="MULTI DRIVE") ELSE (Set driveSetUp="SINGLE DRIVE")
set OUTNAME=Creo3-110_%username%_%computername%_Info_%date:~10,4%-%date:~4,2%-%date:~7,2%.txt
rem ** Output information about the computer to a file
echo %username% > %USERPROFILE%\Documents\%OUTNAME%
echo %computername% >> %USERPROFILE%\Documents\%OUTNAME%
echo %machine% >> %USERPROFILE%\Documents\%OUTNAME%
echo %machinecpu% >> %USERPROFILE%\Documents\%OUTNAME%
systeminfo | findstr /C:"Total Physical Memory" >> %USERPROFILE%\Documents\%OUTNAME%
echo %GPU_NAME% >> %USERPROFILE%\Documents\%OUTNAME%
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" >> %USERPROFILE%\Documents\%OUTNAME%
echo %bitness% >> %USERPROFILE%\Documents\%OUTNAME%
echo Creo=%CREOVERSION% >> %USERPROFILE%\Documents\%OUTNAME%
echo Drive Free Space Size >> %USERPROFILE%\Documents\%OUTNAME%
wmic /node:"%COMPUTERNAME%" LogicalDisk Where DriveType="3" Get DeviceID,FreeSpace,Size|find /I "c:" >> %USERPROFILE%\Documents\%OUTNAME%
wmic /node:"%COMPUTERNAME%" LogicalDisk Where DriveType="3" Get DeviceID,FreeSpace,Size|find /I "d:" >> %USERPROFILE%\Documents\%OUTNAME%
wmic /node:"%COMPUTERNAME%" LogicalDisk Where DriveType="3" Get DeviceID,FreeSpace,Size|find /I "e:" >> %USERPROFILE%\Documents\%OUTNAME%
echo %DriveSetUp% >> %USERPROFILE%\Documents\%OUTNAME%
getmac /v >> %USERPROFILE%\Documents\%OUTNAME%
echo ===== >> %USERPROFILE%\Documents\%OUTNAME%
@echo off
setlocal
set varcounter=0
set wmicmd="wmic NICCONFIG WHERE IPEnabled=true GET IPAddress"
for /f "tokens=1 delims={, skip=1" %%a in ('%wmicmd%') do call :SETVAR %%a
endlocal
goto :COPYFILE
:SETVAR
set /a varcounter=%varcounter% + 1
if not {%1}=={} (
echo NIC %varcounter% address is {%1} >> %USERPROFILE%\Documents\%OUTNAME%
set NIC%varcounter%=%1
)
goto :COPYFILE
:COPYFILE
copy %USERPROFILE%\Documents\%OUTNAME% "\\<servername>\<sharename>\System Info\."
I get a folder with text files that are named like this like this:
Creo3-110_<UserName>_<MachineName>_Info_2017-03-23.txt