How to install ClickOnce application without user request?

Is there a way to install the ClickOnce application without prompting the user at all? I am talking about "Run / Do not Run", which the user receives when he first starts the application.

There seem to be some hints here , but I believe that it skips the โ€œElevationโ€ (UAC) and security hints, rather than the actual โ€œRun / Do not Runโ€ initial screen.

I can find information on how to silently update an application that was installed in the past, but nothing about simply installing the application for the first time.

I also found this post , which seems to be related, but again, not sure if we are talking about the same user request ...

+5
source share
4 answers

Cannot install ClickOnce application without user request. if you want the user to double-click on it and it just installs without checking with the user, do not use ClickOnce. Honestly, in my experience, only malware and packages moved via SMS in a corporate environment are installed without any requests to the user.

+2
source

"" / " ", , , .application . login script - . , - , , . , , .

, "" / " ", ClickOnce, . , ClickOnce . - , .

, , , . , TechNet : http://technet.microsoft.com/en-us/library/cc770315 (v = WS.10).aspx, :

  • .

  • , . , , , .

  • "". .

  • " " \ " Windows" \ " " \ " " \ " ".

  • "" "".

  • , .

  • , , . , 5 6, .

+6

MikeBazs Answer, " ", "" Click-Once- "" " " ( , / )

"", , , , :

1.) : Visual Studio , .

2.) :. , , ( ): Trusted Publishers Trusted Root Certification Authorities

- . , :

3.) powershell script, , setup.exe :

if (-not (Test-Path env:APPInstalled)){
  Start-Process "\\server\share\Application\setup.exe"

  # Set Flag for "Installed"
  [Environment]::SetEnvironmentVariable("APPInstalled", "1", "User")
}

User-Environment APPInstalled, , .

script, . .

4.) : . (.. ), :

private void Form1_Load(object sender, EventArgs e)
    {
        //first run? That a initial deployment, close application.
        if (!File.Exists("C:\\some\\static\\path\\notfirstrun.dat"))
        {
            File.WriteAllText("C:\\some\\static\\path\\notfirstrun.dat", "1");
            Application.Exit();
        }

thaht script, , , .

"click":

powershell script Startup-Folder - , . Login- Script, , Click-Once.

"this", vbs script, powershell script. , , powershell-:

Dim objShell
Set objShell=CreateObject("WScript.Shell")

strCMD="powershell.exe -sta -noProfile -NonInteractive -nologo -ExecutionPolicy Bypass -f \\server\share\scripts\install_App.ps1" 
objShell.Run strCMD,0,True

, "" " ", vbs - script 30 , .

, , "" .

:

  • run installation using powershell script
  • wrap that powershell script inside an irresistible vbs script
  • Deploy the vbs script on each computer using the task scheduler to ensure that it runs in the context of users.
+1
source

All Articles