It is currently December 1st, 2021, 6:40 pm

Silent install

General topics related to Rainmeter.
User avatar
death.crafter
Rainmeter Sage
Posts: 1204
Joined: April 24th, 2021, 8:13 pm

Silent install

Post by death.crafter »

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
User avatar
jsmorley
Developer
Posts: 22416
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Silent install

Post by jsmorley »

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?
No cheating... ;-)

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.
User avatar
death.crafter
Rainmeter Sage
Posts: 1204
Joined: April 24th, 2021, 8:13 pm

Re: Silent install

Post by death.crafter »

jsmorley wrote: July 17th, 2021, 2:03 pm No cheating... ;-)

We are looking into it. Hope to have figured out the ins and outs and pluses and minuses of WinGet sometime next week.
Actually it would be nice... It's a lot of clicks currently :rolmfao:
Including opening the browser typing in rainmet and enter. click on download. Click on downloaded file. And so on.
from the Realm of Death
User avatar
jsmorley
Developer
Posts: 22416
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Silent install

Post by jsmorley »

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.


1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
death.crafter
Rainmeter Sage
Posts: 1204
Joined: April 24th, 2021, 8:13 pm

Re: Silent install

Post by death.crafter »

jsmorley 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.
Hmm.. Like literally ;-)
ezgif-6-4a4d8c2acc85.gif
You do not have the required permissions to view the files attached to this post.
from the Realm of Death
User avatar
jsmorley
Developer
Posts: 22416
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Silent install

Post by jsmorley »

Yep.. Like that.

Not sure for most people it's head and shoulders better than:


1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22416
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Silent install

Post by jsmorley »

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:

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
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.
User avatar
death.crafter
Rainmeter Sage
Posts: 1204
Joined: April 24th, 2021, 8:13 pm

Re: Silent install

Post by death.crafter »

jsmorley 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:

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
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.
I don't think the Start-Process part is necessary. WinGet works directly from powershell, as you saw in the gif I made. Just

Code: Select all

winget upgrade rainmeter
would be enough.

And why do you need to set the working directory? Wouldn't it automatically start there?
from the Realm of Death
User avatar
jsmorley
Developer
Posts: 22416
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Silent install

Post by jsmorley »

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. Just

Code: Select all

winget upgrade rainmeter
would be enough.

And why do you need to set the working directory? Wouldn't it automatically start there?
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".

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
So that does not require an elevated Powershell window, while installing and starting Rainmeter.


1.jpg


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.
User avatar
death.crafter
Rainmeter Sage
Posts: 1204
Joined: April 24th, 2021, 8:13 pm

Re: Silent install

Post by death.crafter »

jsmorley wrote: July 17th, 2021, 3:12 pm 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".
If you just do

Code: Select all

explorer.exe "$($env:SYSTEMDRIVE)\Program Files\Rainmeter\Rainmeter.exe"
, wouldn't it start without elevation?
from the Realm of Death