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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Creo 4 Uninstall Piece by Piece

jwagh
17-Peridot

Creo 4 Uninstall Piece by Piece

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!

1 ACCEPTED SOLUTION

Accepted Solutions
davehaigh
11-Garnet
(To:jwagh)

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:

4-27-2017 8-35-03 AM.jpg

I typed in datecode [f000] in the search field to get most of them.

4-27-2017 8-22-24 AM.jpg

My first hit was for Flexnet, what you want is the key that says UninstallString.

4-27-2017 8-21-43 AM.jpg

Every component should have one.

4-27-2017 8-22-58 AM.jpg

4-27-2017 8-24-03 AM.jpg

4-27-2017 8-24-35 AM.jpg

4-27-2017 8-25-00 AM.jpg

4-27-2017 8-25-22 AM.jpg

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.

4-27-2017 8-25-57 AM.jpg

Hi-lite the value data field and RMB Copy.

4-27-2017 8-26-20 AM.jpg

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:

  1. MsiExec.exe /X{0430FEB4-0CC6-4447-84D3-08443E4977CB} /qn  REBOOT=ReallySuppress

View solution in original post

12 REPLIES 12
davehaigh
11-Garnet
(To:jwagh)

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:

4-27-2017 8-35-03 AM.jpg

I typed in datecode [f000] in the search field to get most of them.

4-27-2017 8-22-24 AM.jpg

My first hit was for Flexnet, what you want is the key that says UninstallString.

4-27-2017 8-21-43 AM.jpg

Every component should have one.

4-27-2017 8-22-58 AM.jpg

4-27-2017 8-24-03 AM.jpg

4-27-2017 8-24-35 AM.jpg

4-27-2017 8-25-00 AM.jpg

4-27-2017 8-25-22 AM.jpg

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.

4-27-2017 8-25-57 AM.jpg

Hi-lite the value data field and RMB Copy.

4-27-2017 8-26-20 AM.jpg

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:

  1. MsiExec.exe /X{0430FEB4-0CC6-4447-84D3-08443E4977CB} /qn  REBOOT=ReallySuppress
jwagh
17-Peridot
(To:davehaigh)

A couple of questions:

  1. Is the gibberish value the same for all computers? (MsiExec.exe /I{319DF626-D04C-4CF6-B4F7-27080294A4A0})
  2. Do these gibberish values change each datecode or version? I would assume so. So every version I would need to go through this process again? We could have users, who barely use the software and be 2, 3 or even 7 versions behind on the software. The batch would need to be smart enough to know that and account for that. I'm a little concerned that I would need to check for each one of these MsiExec values if they change for each iteration.

Thanks!

davehaigh
11-Garnet
(To:jwagh)

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.

4-27-2017 9-27-51 AM.jpg

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

jwagh
17-Peridot
(To:davehaigh)

Finished Editing last post. Thanks again.

davehaigh
11-Garnet
(To:jwagh)

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%)

jwagh
17-Peridot
(To:davehaigh)

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.

davehaigh
11-Garnet
(To:jwagh)

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.

jwagh
17-Peridot
(To:davehaigh)

Thanks for your help.

bmüller
13-Aquamarine
(To:jwagh)

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.

  • Start, this spawns a new process separate from the command shell.
  • And then add the /Wait option to the uninstall string.

When the uninstall is complete, the spawned process dies and at that point the batch script resumes processing commands.

 

Syntax looks like this:

  • rem ** Remove Creo Agent
  • start /wait MsiExec.exe /X{7F89E552-7586-4840-9EB5-3D56733BE98C} /qn  REBOOT=ReallySuppress

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

  • rem ** Remove all versions of Creo View  (This can be removed if you don't wish to re-install Creo View)
  • wmic product where (name like "%%Creo View%%") call uninstall /nointeractive
  •  
  • rem ** Waiting until WMIC.exe is finished.
  • :LOOP02
  • tasklist | find /i "WMIC" >nul 2>&1
  • IF ERRORLEVEL 1 (
  •   GOTO CONTINUE03
  • ) ELSE (
  •   ECHO WMIC is still running
  •   Timeout /T 5 /Nobreak
  •   GOTO LOOP02
  • )
  •  
  • :CONTINUE03

 

PTC’s Uninstall.exe

Newer versions of Creo Parametric contain uninstall executables for various components of the software. They are located here:

  • Creo Parametric Help
    • "C:\ptc\Creo 3.0\help\creo_help_pma\bin\uninstall.exe"
  • Creo Simulate Help
    • "C:\ptc\Creo 3.0\help\creo_help_sim\bin\uninstall.exe"
  • Creo Simulate
    • "C:\ptc\Creo 3.0\M120\Simulate\bin\uninstall.exe"
  • Creo Parametric
    • "C:\ptc\Creo 3.0\M120\Parametric\bin\uninstall.exe"

 

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

  • rem ** Creo Simulate Help
  • "C:\ptc\Creo 3.0\M120\Creo 3.0\help\creo_help_sim\bin\uninstall.exe" -quiet
  •  
  • rem ** Waiting until pmiuninstall.exe is finished.
  • :LOOP03
  • tasklist | find /i " pmiuninstall" >nul 2>&1
  • IF ERRORLEVEL 1 (
  •   GOTO CONTINUE04
  • ) ELSE (
  •   ECHO pimuninstall is still running
  •   Timeout /T 5 /Nobreak
  •   GOTO LOOP03
  • )
  •  
  • :CONTINUE04
bmüller
13-Aquamarine
(To:bmüller)

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

Top Tags