c# - Exit code from ClickOnce application installation -
i found couple ways of running .application
clickonce file. 1 can run file executable (and let explorer rest) or run explorer using rundll32.exe
.
the thing want wait until clickonce application finished installation. waiting exit code start-process \path\to\file.application -wait
doesn't make sense because clickonce app runs different process named dfsvc.exe
. thing process runs in background , not exit after installation complete can't wait until appears , wait until exits.
how can programmatically check clickonce app finished installing?
mike,
if understand situation, have several applications, 1 of clickonce application, , these applications install synchronously, each application installing before proceeding next one.
i've run similar situation on few occasions clickonce , have verified installation completes below:
i select files installed part of clickonce installation process, , check existence before continuing next application in synchronous lineup. done through overarching install script or exe monitor install of each successive application. i'll use loop, checking , pausing before installing next program in lineup. below sample code give idea of mean:
int filefoldercount = 0; while (filefoldercount != beforeinstallcount.count() || process.getprocessesbyname("exetoinstall").length != 0) { thread.sleep(timespan.fromseconds(15)); filefoldercount = new directoryinfo(clickoncefilesdir) .getfiles("regexptofindclickoncefiles", searchoption.alldirectories) .count() // recurse through clickoncefilesdir , pull files match regexptofindclickoncefiles. ideally these files i'm looking part of install. }
once install has completed, files present, satisfying first part of loop condition, , second condition applications set run upon install, can closed before proceeding next application in line installation.
hth
Comments
Post a Comment