if run setup.exe of application, , certificate not trusted certificate in store. following dialog box.
and long user clicks install fine.
now have application, portal, launches clickonce applications. portal installed , accepted certificate (different pfx file).
now when portal goes launch application 1 through code, above prompt doesn't shown (because running under security context?). of code inplacehostingmanager microsoft's website.
now when application 1 runs, gets errors user has denied privliges. understand because user never clicked above warning, application 1 not have permissions needs. microsoft's website:
if application uses trusted application deployment, common language runtime (clr) trust manager examines deployment manifest determine whether contains valid trust license. if deployment manifest not contain valid trust license, clickonce stops installation , throws trustnotgrantedexception. update never display prompt asking user if want grant application permission run.
so left options.
get valid certificate. these applications, can't justify cost of $400 2 years. looking creating our own, however, getting certificate deployed internal client machines network team may comfortable with. invovled in adding certificates trusted root throughout company.
or somehow detect if application installed. if not, call out setup.exe. if run, existing deploy code. how determine if application installed?
so way solved see if app installed. if run .application file, if not run setup.exe file if user clicked on it.
if (not system.io.file.exists(string.format(app.applicationlaunchdirectory, environment.getfolderpath(environment.specialfolder.userprofile)))) process.start(app.applicationsetupdirectory) else dim deploymenturi new uri(app.applicationlocation) inplacehosting = new inplacehostingmanager(deploymenturi, false) appinfo = app pf.setvalues("starting application", 0) pf.show() inplacehosting.getmanifestasync() end if
where
applicationlaunchdirectory = {0}\appdata\roaming\microsoft\windows\start menu\programs\app\app.appref-ms applicationsetupdirectory = <networkdrive>\app\setup.exe applicationlocation = <networkdrive>\app\app.application
Comments
Post a Comment