StrCMD="powershell.exe -sta -noProfile -NonInteractive -nologo -ExecutionPolicy Bypass -f \\server\share\scripts\install_App.ps1"įinally, Use a GPO to deploy your vbs-script into the startup folder of any user.Īll the user will see is the "installation" Progress. Set objShell=CreateObject("WScript.Shell") Note, that this is executed in the user context, so the user needs permissions to execute powershell-scripts: Dim objShell If we set it as Login-Script, It doesn't run in the user-context, which is required for Click-Once.Īs a workaround to "this" problem, you can wrap it inside a vbs script, calling the powershell script. If we setup the powershell script in the Startup-Folder - it pops up, which is ugly. Now, users can execute that script, only getting an installation once with no further confirmation required and the application does not "Auto-start" after setup.īut we want to avoid the "click" as well: first run? That's a initial deployment, close application.įile.WriteAllText("C:\\some\\static\\path right after installation) I just shut it down again: private void Form1_Load(object sender, EventArgs e) But the application starts after the installation.Ĥ.) Modify the sourcecode of your application: I used a dummy file to detect the firstrun of the application. Now, users can execute that script, only getting an installation once with no further confirmation required. Start-Process "\\server\share\MyApplication\Application\setup.exe" # MyApplicationName not installed, install! But we want Zero clicks:ģ.) Create a powershell script, located on a server, which invokes the setup.exe of your application, if not already installed: $appInfo = Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall | foreach-object | select displayName Now, users are able to install the application with a single click - no security question. There are a few "Issues" to consider, but if you follow this guide, the outcome should be what you need:ġ.) Sign your application: Within visual Studio you can easily sign your application with your own certificate, that's no big deal.Ģ.) Distribute the certificate: In order to avoid the dialog, if the application should be installed, you need to distribute YOUR certificate to the following stores on any Machine (Use a GPO for that): Trusted Publishers and Trusted Root Certification Authorities In Addition to MikeBazs Answer, i'd like to provide the following "Workaround" which makes the Installation of a Click-Once-Application "non-interactive" and "almost silent" (User sees the progress-window during installation, no clicking required and/or possible) In the navigation pane, click Trusted Root Certification Authorities, and then repeat steps 5 and 6 to install a copy of the certificate to that store. If the certificate is self-signed, and cannot be traced back to a certificate that is in the Trusted Root Certification Authorities certificate store, then you must also copy the certificate to that store. In the navigation pane, open Computer Configuration\Windows Settings\Security Settings\Public Key Policies\Trusted Publishers.Ĭlick the Action menu, and then click Import.įollow the instructions in the Certificate Import Wizard to find and import the certificate. Group Policy Management Editor opens, and displays the current contents of the policy object. Right-click the GPO, and then select Edit. Ensure that the GPO is associated with the domain, site, or organizational unit whose users you want affected by the policy. There's information on how to do that at TechNet here: (v=WS.10).aspx, reproduced here briefly:įind an existing or create a new GPO to contain the certificate settings. So, have the network administrators push out a group policy that trusts the code-signing certificate that is being used to sign your application. Even self-signed is okay if you have the right stuff configured on the client machine. The key is that the ClickOnce has to be signed by a trusted publisher. I know you can bypass the "Run"/"Don't Run" prompt because I just did it successfully with a ClickOnce we deploy as a custom shell on kiosk machines. The other question you linked to hovers around this but it doesn't really get you all the way. Presumably you have solved that problem somehow as it is implied in your question that you have. However, you may be able to launch it through a login script or something along those lines. It's possible to avoid the "Run"/"Don't Run" prompt, although you still have the issue of actually copying the files over to the user, which usually requires them launching the.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |