It is currently October 15th, 2024, 12:54 am
Silent install
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Silent install
I just saw a commit was made about installer supporting silent install. So does that mean Rainmeter will be available through Win-Get?
from the Realm of Death
-
- Developer
- Posts: 22856
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Silent install
No cheating...death.crafter wrote: ↑July 17th, 2021, 2:01 pm I just saw a commit was made about installer supporting silent install. So does that mean Rainmeter will be available through Win-Get?
We are looking into it. Hope to have figured out the ins and outs and pluses and minuses of WinGet sometime next week.
We did add silent install to the installer. I'm getting ready to work on some documentation on that and get a beta out this weekend.
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Re: Silent install
Actually it would be nice... It's a lot of clicks currently
from the Realm of Death
-
- Developer
- Posts: 22856
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Silent install
Not sure it's going to be a lot less work using WinGet. You will need to open a cmd or Powershell window (Windows Terminal from the Start menu right-click in Win11) "As Administrator" and then execute whatever command to WinGet is required. That might be just WinGet -Upgrade Rainmeter or some such, but if you need to add parameters to the install, it might be a bit more complicated. Still, it's an interesting concept, and we hope to get it implemented pretty soon.
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Re: Silent install
Hmm.. Like literallyjsmorley wrote: ↑July 17th, 2021, 2:14 pm Not sure it's going to be a lot less work using WinGet. You will need to open a cmd or Powershell window "As Administrator" and then execute whatever command to WinGet is required. That might be just WinGet -Upgrade Rainmeter or some such, but if you need to add parameters to the install, it might be a bit more complicated. Still, it's an interesting concept, and we hope to get it implemented pretty soon.
You do not have the required permissions to view the files attached to this post.
from the Realm of Death
-
- Developer
- Posts: 22856
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Silent install
Yep.. Like that.
Not sure for most people it's head and shoulders better than:
Not sure for most people it's head and shoulders better than:
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22856
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Silent install
The silent install will exit Rainmeter, and will NOT restart Rainmeter automatically when it is done, so I expect that some kind of .ps1 script will be desirable for this, so it can start Rainmeter at the end of the process.
Something like this maybe:
I think this could be run by just right-clicking the .ps1 file, and selecting "Run with Powershell". The WinGet will elevate itself with a UAC prompt when executed. We do NOT want you running Rainmeter itself "As Administrator". That is why the silent install, WinGet or manually, doesn't start it up. In order to be "silent", the installer must be run "As Administrator" in order to be allowed to write to C:\Program Files without a UAC prompt. It will just fail entirely if it is not run elevated.
Something like this maybe:
Code: Select all
Write-Host Getting Rainmeter from WinGet
Start-Process -FilePath WinGet -ArgumentList "-upgrade Rainmeter" -wait -verb runas
Write-Host Starting Rainmeter...
Start-Process -FilePath "C:\Program Files\Rainmeter\Rainmeter.exe" -WorkingDirectory "C:\Program Files\Rainmeter"
Start-Sleep -s 1
stop-process -Id $PID
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Re: Silent install
I don't think the Start-Process part is necessary. WinGet works directly from powershell, as you saw in the gif I made. Justjsmorley wrote: ↑July 17th, 2021, 2:43 pm The silent install will exit Rainmeter, and will NOT restart Rainmeter automatically when it is done, so I expect that some kind of .ps1 script will be desirable for this, so it can start Rainmeter at the end of the process.
Something like this maybe:
I think this could be run by just right-clicking the .ps1 file, and selecting "Run with Powershell". The WinGet will elevate itself with a UAC prompt when executed. We do NOT want you running Rainmeter itself "As Administrator". That is why the silent install, WinGet or manually, doesn't start it up. In order to be "silent", the installer must be run "As Administrator" in order to be allowed to write to C:\Program Files without a UAC prompt. It will just fail entirely if it is not run elevated.Code: Select all
Write-Host Getting Rainmeter from WinGet Start-Process -FilePath WinGet -ArgumentList "-upgrade Rainmeter" -wait -verb runas Write-Host Starting Rainmeter... Start-Process -FilePath "C:\Program Files\Rainmeter\Rainmeter.exe" -WorkingDirectory "C:\Program Files\Rainmeter" Start-Sleep -s 1 stop-process -Id $PID
Code: Select all
winget upgrade rainmeter
And why do you need to set the working directory? Wouldn't it automatically start there?
from the Realm of Death
-
- Developer
- Posts: 22856
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Silent install
I'm looking at Start-Processs in order to pass the -verb runas. My hope is that you don't need to elevate the entire .ps1 script to run it, so Rainmeter is not started "As Administrator".death.crafter wrote: ↑July 17th, 2021, 3:07 pm I don't think the Start-Process part is necessary. WinGet works directly from powershell, as you saw in the gif I made. Justwould be enough.Code: Select all
winget upgrade rainmeter
And why do you need to set the working directory? Wouldn't it automatically start there?
If you just want to use WinGet in a Powershell window, just open that As Administrator, and type in what you did. That won't start Rainmeter at the end though. I'm still exploring a bit.
I set the working directory out of an abundance of caution. The shortcut for Rainmeter sets the working directory.
Can't really test this with WinGet yet, but I have a .ps1 script working that does what I want just running the installer with the new silent install:
Code: Select all
$installerARG=$args[0]
Write-Host Installing Rainmeter...
Start-Process -FilePath $installerARG -ArgumentList "/S /LANGUAGE=1033 /PORTABLE=0 /VERSION=64 /AUTOSTARTUP=1 /D=`"C:\Program Files\Rainmeter`"" -verb runas
Write-Host Waiting 2 seconds...
Start-Sleep -s 2
Write-Host Starting Rainmeter...
Start-Process -FilePath "C:\Program Files\Rainmeter\Rainmeter.exe" -WorkingDirectory "C:\Program Files\Rainmeter"
Start-Sleep -s 1
stop-process -Id $PID
This may be trickier than I hope, since WinGet is a native cmd/console application when it is opened with Start-Process. This will take some playing around with. I just am not entirely happy that just running WinGet requires me to go find the shortcut for Rainmeter and run it at the end.
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Re: Silent install
If you just do
Code: Select all
explorer.exe "$($env:SYSTEMDRIVE)\Program Files\Rainmeter\Rainmeter.exe"
from the Realm of Death