Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

How to terminate and uninstall older version of app before upgrade

Hi

If I see how VLC package is done, I see this. 

success
2023-04-28 09:15:45.055 Starting to install: VLC Media Player
2023-04-28 09:15:45.283 Running command: cmd.exe /s /c %WINDIR%\System32\taskkill.exe /f /im vlc.exe
2023-04-28 09:15:46.619 Step executed successfully
2023-04-28 09:15:46.790 Running command: cmd.exe /s /c "C:\Program Files (x86)\VideoLAN\VLC\uninstall.exe" /S
2023-04-28 09:15:47.511 Step failed, error mode is set to Continue
2023-04-28 09:15:47.695 Downloading from: https://download.videolan.org/pub/videolan/vlc/3.0.18/win64/vlc-3.0.18-win64.exe
2023-04-28 09:15:50.044 Running command: vlc-3.0.18-win64.exe /S
2023-04-28 09:16:08.520 Step executed successfully

First vlc.exe is terminate if vlc. is running.
Then VLC is uninstalled silently by uninstall.exe
Then VLC is downloaded and installed

Nice

I have created a package that should install Lightshot

In the first step I run these two commands by Powershell

cmd.exe /s /c %WINDIR%\System32\taskkill.exe /f /im lightshot.exe
cmd.exe /s /c "C:\Program Files (x86)\Skillbrains\lightshot\uninst000.exe" /S

If lightshot is not running, the isntallation of package fails
ERROR: The process "lightshot.exe" not found.

If lightshot is running, the first command terminate it (hoorey)
But the second command for uninstallation fail always

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Step failed, error mode is set to StopAsError
Failed to run task 'dvc_task_128bcb9bc20d46678e2'

I need to know

  1. How not to be stopped if package installation when app is not running
  2. How to uninstall it

Thanks for your help

0

Comments

2 comments
Date Votes
  • Meanwhile I have found I had mistype. There must be unins000.exe, not uninst000.exe

    But now, even if the path is ok, it failed as well

    2023-04-28 17:15:26.968 Starting to install: Ligthshot
    2023-04-28 17:15:27.211 Writing embedded file: Invoke-EmbeddedScript-da5d58.ps1
    2023-04-28 17:15:27.402 Running command: 'Invoke-EmbeddedScript-da5d58.ps1' 
    2023-04-28 17:15:27.982 SUCCESS: The process "Lightshot.exe" with PID 5772 has been terminated.
    2023-04-28 17:15:27.982 Step executed successfully
    2023-04-28 17:15:28.242 Writing embedded file: Invoke-EmbeddedScript-7d53ba.ps1
    2023-04-28 17:15:28.442 Running command: 'Invoke-EmbeddedScript-7d53ba.ps1' 
    2023-04-28 17:20:26.979 Timeout: task took longer than package time limit.

    0
  • Hi Alesh,

    the default time for execution is only 5 minutes, that is not enough for many setups to complete.
    I suggest you extend the Timeout from 5 to at least 15 minutes so everything has enough time to succesfully finish.

    Also, it might be more practical to execute command without start, because that way the net step is not waiting for the previous to finish.
    You can call common executables just fine.
    taskkill /f /im some.exe
    BTW - join Discord for faster responses, see link down below.

    0