InstallerBldr
Posts: 13
Joined: Thu Nov 09, 2017 1:26 am

100% CPU uninstall

Thu Mar 01, 2018 8:51 pm

Advanced Installer Enterprise v14.5.2 b83143

On uninstall on 2008R2 system, two bat files are left consuming 100% CPU. Seems to be happening while the uninstaller UI is displaying the text "Removing backup files". I have repeated this reliably several times on uninstallation.

Examples are:
File 1 'EXE5624.tmp.bat'
Contents:
@echo off
ATTRIB -r "C:\PROGRA~3\Caphyon\ADVANC~1\{1097A~1"
:try
rd "C:\PROGRA~3\Caphyon\ADVANC~1\{1097A~1"
if exist "C:\PROGRA~3\Caphyon\ADVANC~1\{1097A~1" goto try
ATTRIB -r "C:\Users\MYUSER~1\AppData\Local\Temp\EXE5624.tmp.bat"
del "C:\Users\MYUSER~1\AppData\Local\Temp\EXE5624.tmp.bat" | cls

File 2 'EXE5587.tmp.bat'
Contents:
@echo off
ATTRIB -r "C:\PROGRA~3\Caphyon\ADVANC~1\{1097A~1\MYPROD~1.EXE"
:try
del "C:\PROGRA~3\Caphyon\ADVANC~1\{1097A~1\MYPROD~1.EXE"
if exist "C:\PROGRA~3\Caphyon\ADVANC~1\{1097A~1\MYPROD~1.EXE" goto try
ATTRIB -r "C:\Users\MYUSER~1\AppData\Local\Temp\EXE5587.tmp.bat"
del "C:\Users\MYUSER~1\AppData\Local\Temp\EXE5587.tmp.bat" | cls

When the 2 cmd.exe processes fronting these bat files are killed via the Windows Task Manager, the installer will not proceed further with the 'Next' button.

Please advise, thanks.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: 100% CPU uninstall

Fri Mar 02, 2018 12:20 pm

Hello,

Can you please send us by email to support at advancedinstaller dot com the following resources:

1. the AIP (project file) so we can test and investigate its settings
2. a verbose log of the uninstall
3. if possible, a download link for your built setup package so we can download and test it on our side too

We will need to further investigate this on our side.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

InstallerBldr
Posts: 13
Joined: Thu Nov 09, 2017 1:26 am

Re: 100% CPU uninstall

Fri Mar 02, 2018 11:14 pm

I'm afraid I cannot share the installer executable. It contains a proprietary product I am bound not to release.

Instead I have a feature change request for those generated bat files that AI produces.

The problem with the way they behave now is that while they wait, they hammer the user's system at 100% CPU until the resource they are waiting for frees up. Even when that step completes successfully, if you watch the CPU usage it spikes to 100% from the start of the "Removing backup files" stage until the user clicks 'Finish'. To be clear, 100% CPU the whole time so if the user walks away without clicking 'Finish', or if the user kills the installation process at this time, the machine stays at max CPU. This needs to be industrialized a bit.
201803021517 - CPU maxxed during AI busy wait.png
201803021517 - CPU maxxed during AI busy wait.png (282.38KiB)Viewed 7227 times
201803021526 - CPU stops maxxing out on Finish button click.png
201803021526 - CPU stops maxxing out on Finish button click.png (103.87KiB)Viewed 7226 times
Here is a solution for AI to modernize that functionality for everyone. The following code is designed such that it is quick if the resource is available, but gracefully extends its time between tries each time the resource comes back unavailable, until it maxes out at a 4 second pulse.

This will solve that busy wait CPU spike for all AI's users with busy file systems or slower disks (like on a busy VM), while not delaying for users with responsive systems.

Can you please implement this ASAP?

Thank you.

File 2 'EXE5587.tmp.bat' rewritten (refers to the original file with the same name in the root post)
Contents:

@if (@CodeSection == @Batch) @then
@echo off
setlocal

set /a nice = 1

ATTRIB -r "C:\PROGRA~3\Caphyon\ADVANC~1\{1097A~1\MYPROD~1.EXE"
:try

del "C:\PROGRA~3\Caphyon\ADVANC~1\{1097A~1\MYPROD~1.EXE"

if exist "C:\PROGRA~3\Caphyon\ADVANC~1\{1097A~1\MYPROD~1.EXE" (
set /a msDelay = %nice%
set /a "msDelay = 1 << nice"
call :pause %msDelay%
if %nice% lss 12 (set /a nice += 1)
goto :try
) else (
ATTRIB -r "C:\Users\MYUSER~1\AppData\Local\Temp\EXE5587.tmp.bat"
del "C:\Users\MYUSER~1\AppData\Local\Temp\EXE5587.tmp.bat" | cls
goto :EOF
)

:pause <ms>
cscript /nologo /e:JScript "%~f0" "%~1"
goto :EOF

@end // end batch / begin JScript hybrid code
WSH.Sleep(WSH.Arguments(0));

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: 100% CPU uninstall

Mon Mar 05, 2018 1:00 pm

Hello,

Thank you for your follow up on this and for your improvement suggestion. I've forwarded this to our development team and hopefully they will react positively to your suggestion.

As soon as such improvement will be adopted we will update this thread.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

InstallerBldr
Posts: 13
Joined: Thu Nov 09, 2017 1:26 am

Re: 100% CPU uninstall

Mon Mar 05, 2018 6:10 pm

Thank you for your reply.

I want to be clear that we consider this a bug that needs to be fixed ASAP. We are installing our products on high traffic servers and cannot have the server unresponsive due to a period of 100% CPU usage by an installer utility waiting for a resource.

Can you please prioritize this fix? This, along with the config file problems viewtopic.php?f=2&t=34342&p=97733#p97733, is a blocking issue for us. We cannot release until this is fixed.
Thanks

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: 100% CPU uninstall

Tue Mar 06, 2018 10:41 am

Hello,
I want to be clear that we consider this a bug that needs to be fixed ASAP. We are installing our products on high traffic servers and cannot have the server unresponsive due to a period of 100% CPU usage by an installer utility waiting for a resource.

Can you please prioritize this fix?
Yes, I added a high priority for your request and hopefully this will be available soon. However, I cannot give you any ETA for now. As soon as an improvement will be out we will update this thread.
This, along with the config file problems viewtopic.php?f=2&t=34342&p=97733#p97733, is a blocking issue for us. We cannot release until this is fixed.
You can see my reply on the "Duplicate comments in web.config file." forum's thread.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

InstallerBldr
Posts: 13
Joined: Thu Nov 09, 2017 1:26 am

Re: 100% CPU uninstall

Tue Mar 06, 2018 11:27 pm

Thanks Daniel

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: 100% CPU uninstall

Wed Mar 07, 2018 9:46 am

You are always welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: 100% CPU uninstall

Mon Jun 04, 2018 4:49 pm

Hello,

This was fixed in version 14.9 of Advanced Installer released on May 24th, 2018.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”