Avoiding reboot after upgrade

Got a problem you cannot solve? Try here.
Bo Andersen
Posts: 33
Joined: Mon Jul 16, 2007 5:07 am
Location: Denmark

Avoiding reboot after upgrade

Postby Bo Andersen » Thu Mar 07, 2013 6:38 am

Hi All,

Maybe someone has good ideas on this.

My installer installs a web site under IIS.
We create a named application pool during installation.

When the app is uses, some DLLs are locked.
I can release by executing an IISreset command prior to upgrade (the uninstall part) and thus avoid that DLLs are locked. The downside is that all websites on the server are reset.

I can also achieve the same by recycling the app pool using

Code: Select all

~InstallAware Clipboard Data~
~Run Program~
~{397D1CFC-6971-43D9-8B95-073509CF5BDD}~
~$WINSYSDIR$\inetsrv\APPCMD.exe~
~TRUE~
~appcmd recycle apppool /apppool.name:DynPool~
~TRUE~
~~

-this is much better, because it only affects my app (unless someone used my app pool for other things)

However, this only works if the have not "messed" with the IIS config - Ie. if my customer has assignes a different app pool, this method will fail

SO, my question is:
How can I find out if the DLLs are locked?
actually - how can I find out if
Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
will return "REBOOT" before executing this step?

If I can see that it will return REBOOT, then I could offer to do an IISRESET to avoid.

Would it work to do something like
Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
if Variable REMOVEOLD Equals REBOOT
Run Program IISReset (WAIT)
Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
end
(in effect trying the remove twice if first attempt resultetd in reboot)

Ideas appreciated.

Best regards
Bo

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Avoiding reboot after upgrade

Postby FrancescoT » Thu Mar 07, 2013 11:26 am

Dear Bo,

I believe that it is bit complicated and even not suggested, to find out if a dll has been loaded from a given process.

Why don't you try the following?

1- during update, stop your WebApp or Web site and set "Start Automatically" property as FALSE.
2- Restart the system with "Restart & Resume".
3- Run your update, once files copy is completed set WebApp or Web site "Start Automatically" property as TRUE.
4- Force the system to restart to complete installation.


Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

Bo Andersen
Posts: 33
Joined: Mon Jul 16, 2007 5:07 am
Location: Denmark

Re: Avoiding reboot after upgrade

Postby Bo Andersen » Fri Mar 08, 2013 3:07 am

Hi Francesco,

Thanks - but the whole point is to avoid a restart of anything - if my app dlls are loaded, I can unload by recycling app pool, but I can't know which app pool they run under if a customer has changed the default from IIS manager. An IISreset is bad as it resets all web services on the machine, but a reboot is of course worse.

I found a sysinternals.com tool - Handle.exe - that can write open file handles to a text file. I'm considering using it this way

recycle myAppPool (should work on 95% of my installations)
handle myappdll.dll > tmpfile.txt (get a text file with process ID for process that have myappdll.dll open)
read the tmpfile and see if dll is loaded
if loaded, offer to run IISRESET
then proceed with the REMOVE=ALL
I will post my findings, but hints are welcome

Best regards
Bo

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Avoiding reboot after upgrade

Postby FrancescoT » Fri Mar 08, 2013 9:00 am

Dear Bo,

I'm not an IIS expert ... but probably the steps you posted should work.

I can't imagine anything else that you could try.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: Baidu [Spider] and 129 guests