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)
{
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.