It is currently March 28th, 2024, 12:03 pm

Automate Install and Skin Configuration

Get help with installing and using Rainmeter.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Automate Install and Skin Configuration

Post by SilverAzide »

jsmorley wrote: April 27th, 2020, 2:35 pm I understand the charm, but sorry, it's not going to happen.
I don't mean to hijack this thread (but I will anyway :)), but what about automating the skin packaging process? That's something I would find really useful. For skins with a lot of plug-ins, or advanced options, packaging up the skin can become a real click-fest. I'm ALWAYS forgetting to check that pesky "Merge skins" option, so every time I package up my skins I end up doing it twice. If there were some command-line args a la MSBuild or what-have-you, having a batch file to automate the process would be super handy.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Automate Install and Skin Configuration

Post by jsmorley »

roysubs wrote: April 27th, 2020, 4:43 pm ok, bit confused as this seems to fit in 100% with everything that you said above, with only upsides for Rainmeter. I get that it's your project man, so you are the dictator in charge and that is your privilege which is absolutely your right :) This bit, having "portable" as an install option but without the ability to just grab the latest portable version, is sorta frustrating as it's so easy to do. Hopefully something you can consider for the future since it's zero effort and is 100% in line with the ethos that you expressed above.

I'll shelve my project then. I guess I ain't going to be able to achieve a one-click to "grab Rainmeter portable, configure it, add a skin, and enjoy" even though portable option is already there but frustratingly denied.
‘Any customer can have a car painted any color that he wants so long as it is black.’
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Automate Install and Skin Configuration

Post by Yincognito »

roysubs wrote: April 27th, 2020, 4:43 pm ok, bit confused as this seems to fit in 100% with everything that you said above, with only upsides for Rainmeter. I get that it's your project man, so you are the dictator in charge and that is your privilege which is absolutely your right :) This bit, having "portable" as an install option but without the ability to just grab the latest portable version, is sorta frustrating as it's so easy to do. Hopefully something you can consider for the future since it's zero effort and is 100% in line with the ethos that you expressed above.

I'll shelve my project then. I guess I ain't going to be able to achieve a one-click to "grab Rainmeter portable, configure it, add a skin, and enjoy" even though portable option is already there but frustratingly denied.
Don't shelve your project yet - as I said, for every problem there is a solution. AutoHotKey and the following script (that I just used to download and install the latest Rainmeter version) will do the job. Obviously, AutoHotKey would have to be installed prior to Rainmeter (but I would recommend using a locally verified AutoHotKey install file instead of downloading the latest from the internet for this one), but it's just as easy to do (well, to be honest, even easier) than what you'd like the Rainmeter developers to do:

Code: Select all

; This script was created using Pulover's Macro Creator
; www.macrocreator.com

#NoEnv
SetWorkingDir %A_ScriptDir%
CoordMode, Mouse, Window
SendMode Input
#SingleInstance Force
SetTitleMatchMode 2
#WinActivateForce
SetControlDelay 1
SetWinDelay 0
SetKeyDelay -1
SetMouseDelay -1
SetBatchLines -1


Rainmeter:
WinHttpDownloadToFile("https://github.com/rainmeter/rainmeter/releases/download/v4.4.0.3349/Rainmeter-4.4-r3349-beta.exe", "F:\Wireless")
Sleep, 5000
Run, F:\Wireless\Rainmeter-4.4-r3349-beta.exe
Sleep, 5000
WinActivate, Rainmeter Setup ahk_class #32770
Sleep, 5000
Send, {Enter}
Sleep, 5000
Send, {Enter}
Sleep, 5000
WinActivate, Rainmeter Setup  ahk_class #32770
Sleep, 5000
Send, {Enter}
Sleep, 5000
Send, {Space}
Sleep, 5000
Send, {Tab}
Sleep, 5000
Send, {Enter}
Sleep, 5000
Return


WinHttpDownloadToFile(UrlList, DestFolder)
{
	UrlList := StrReplace(UrlList, "`n", ";")
	UrlList := StrReplace(UrlList, ",", ";")
	DestFolder := RTrim(DestFolder, "\") . "\"

	Loop, Parse, UrlList, `;, %A_Space%%A_Tab%
	{
		Url := A_LoopField, FileName := DestFolder . RegExReplace(A_LoopField, ".*/")
		whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
		whr.Open("GET", Url, True)
		whr.Send()
		If (whr.WaitForResponse())
		{
			ado := ComObjCreate("ADODB.Stream")
			ado.Type := 1 ; adTypeBinary
			ado.Open
			ado.Write(whr.ResponseBody)
			ado.SaveToFile(FileName, 2)
			ado.Close
		}
	}
}
I used Pulover's Macro Creator for all the commands above except the download and run at the start. Of course, the paths are particular to my case, so feel free to modify them. I left a 5 seconds pause / delay between each action, so that it's easy to follow what's going on. I used only keyboard captures (instead of mouse ones), as they are universal and not tied up to the resolution of the screen, the size of the windows, etc. Also, in my case, the script exists in 3 formats: .pmc (of Macro Creator), .ahk (of AutoHotKey) and .exe (exported as such from Macro Creator).

Got only two "issues" while doing the above: it didn't want to start the script and download Rainmeter at the beginning. Naturally, it was because I forgot to delete the default F3 hotkey used to start the script after running the .exe, coupled with my default restrictive firewall policy. As soon as I cleared the path, the magic began to happen... :D

P.S. By the way, this installs the Standard Version, not the Portable one. No need for the portable version if you already can install the standard one, is it? Of course, a single {Tab} key in the right place will choose to install the portable version, if desired.
Last edited by Yincognito on April 28th, 2020, 12:19 am, edited 2 times in total.
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Automate Install and Skin Configuration

Post by Yincognito »

SilverAzide wrote: April 27th, 2020, 4:50 pm I don't mean to hijack this thread (but I will anyway :)), but what about automating the skin packaging process? That's something I would find really useful. For skins with a lot of plug-ins, or advanced options, packaging up the skin can become a real click-fest. I'm ALWAYS forgetting to check that pesky "Merge skins" option, so every time I package up my skins I end up doing it twice. If there were some command-line args a la MSBuild or what-have-you, having a batch file to automate the process would be super handy.
I don't mean to disagree with you, but I will anyway. :sly: In my view, the skin packaging process can be quite different from skin to skin, depending on their complexity, and that's also a field where the skin designer must have full control over. Automation here won't be suited, in my opinion ... although if you're talking about adding the possibility of some "scripts" to ease repeating tasks (e.g. buiding the same complex package over and over again) I won't be necessarily against it. That being said, I'm not sure if the effort of adding this is worth the trouble, since skin packaging is an operation that one does quite rarely anyway.

Apart from that ... I never used the "Merge skins" option, but then I never was an adept of "patching" a previous version with additional bits. I always prefer to start clean such processes, since the opposite reminds me too much of (you know whose) countless "service packs", "updates", "bug fixes" and such, and this approach just makes me think of a job not properly done. But hey, that's just me, there may be such approaches that actually work, after all... :confused:

I also know that your skins might benefit from such a feature, so...
... it's up to the "dictator" to make his move (again). :rofl: I can already see him be like "I understand the charm ... blah blah blah ... but that's just not going to happen". And everybody'll be like :twisted: "we want democracy and justice for all!" :x Viva la Revolucion!!! :great:
roysubs
Posts: 7
Joined: April 3rd, 2020, 7:07 pm

Re: Automate Install and Skin Configuration

Post by roysubs »

Yincognito wrote: April 28th, 2020, 12:07 am I also know that your skins might benefit from such a feature, so... it's up to the "dictator" to make his move (again). :rofl:
hehe. I completely understand him pushing back on implementing new features (I guess bugs and troubleshooting to consider etc), but I'm not asking for any other colour of car than black. I don't want fancy wheel trims or a convertible edition, I just want the existing BLACK EDITION of the car. That's it. I want no new features, just the black car.

Rainmeter: "Hey, we offer a Portable edition!"

NormalUser: "Ok, that's actually bloody amazing(!), Rainmeter is great(!), thanks so much for that, where can we download that!?"

Rainmeter: "What!?!? Why would you ask that! You can't download it! Stop being normal, stop asking normal things! If you want it, you have to download the full installer and then install THAT and then select portable edition!!!"

NormalUser: "Huh?? But doesn't that kind of defeat the purpose of a portable edition? Can't you just offer the portable edition as a 32bit or 64bit .zip file without actually having to implement anything since you can, um, already do that with zero effort, nothing new required?"

Rainmeter: "Of course we could, and that would be ZERO EFFORT for us. We see the charm of it, and we understand that we wouldn't even have to put our beer down since there is nothing to implement, just make the black edition available as the black edition by having the zips available on the site, no work required at all. We understand that it would make it really easy for users to get going with Rainmeter ... and THAT is the PRECISE reason why we will NOT do this! ...".

I guess that's why I'm a wee bit confused by the blanket ban there ... :confused:

Hey @Yincognito, on the AutoHotkey, that's great, thanks for that, I do a lot of projects in AutoHotkey as it happens so I know all of that syntax (I never heard of Pulover's Macro Creator though so that's really good to know! I write all of my AutoHotkey in VS Code), but like you say yeah, it means also having to install the AutoHotkey runtime as an additional step - with a zip of the portable edition we could do everything here from PowerShell in a jiffy without installing the AutoHotkey runtime (most of your excellent code would not be required, it would just be "grab zip from site, unzip it, apply skin, done"). :( All we need are the 32bit / 64bit portable versions on the site <insert :facepalm: emoji here>. Hopefully Sauron will relent. :bow: :great:
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Automate Install and Skin Configuration

Post by Yincognito »

roysubs wrote: April 28th, 2020, 8:47 amI guess that's why I'm a wee bit confused by the blanket ban there ... :confused
I'm not that confused, to be honest, and I would probably have answered the same way (though I fully understand both points of view). The thing is that they already implemented a way to make the portable version available, and to change that approach now (since, as you said, its availability is unquestioned) - or any time some other user with a different idea requests it, for that matter - is kind of redundant.

But then, sure, they could have just linked to the x86 and x64 versions of the portable zips on the site, and that wouldn't have required much work. I guess there are two reasons for this not happening:
- it isn't a request demanded by a lot of users
- maintaining and updating both the installer and those potential links is, again, kind of redundant, basically meaning that the portable version availability would require 4 steps instead of 2 as it is now (i.e. adding the x86/x64 zips in the installer and adding the same zips on the site)

Other than that, there is also the thing with the name of the files. I mean, since the executables or the zips are already in the form of Rainmeter-4.4-r3349-beta.fileextension, there isn't much point to automatically downloading the last Rainmeter version. I may be wrong here and miss some obvious method, but how would you programatically decide which of those names / files should be downloaded (in the case of the GitHub links), or which is the name of the file needed to be downloaded (in the case of Rainmeter.net links)? Point is, even if there would be a portable zip available, you'd still have a hard time figuring out which name / file to choose to download, right? :confused:
roysubs
Posts: 7
Joined: April 3rd, 2020, 7:07 pm

Re: Automate Install and Skin Configuration

Post by roysubs »

Yincognito wrote: April 28th, 2020, 9:34 am But then, sure, they could have just linked to the x86 and x64 versions of the portable zips on the site, and that wouldn't have required much work. I guess there are two reasons for this not happening:
- it isn't a request demanded by a lot of users
- maintaining and updating both the installer and those potential links is, again, kind of redundant, basically meaning that the portable version availability would require 4 steps instead of 2 as it is now (i.e. adding the x86/x64 zips in the installer and adding the same zips on the site)
That's the thing, none of the above would be required! I mean, we all work as Developers, so we know how this works, you just add the generation of the portable editions to the build process. i.e. "create and output the .exe and output the .zip also". Once you add that single step to your build process, you never have to do anything, the zips are auto-generated forever
Yincognito wrote: April 28th, 2020, 9:34 am Other than that, there is also the thing with the name of the files. I mean, since the executables or the zips are already in the form of Rainmeter-4.4-r3349-beta.fileextension, there isn't much point to automatically downloading the last Rainmeter version. I may be wrong here and miss some obvious method, but how would you programmatically decide which of those names / files should be downloaded (in the case of the GitHub links), or which is the name of the file needed to be downloaded (in the case of Rainmeter.net links)?
It's really easy. Your build process just creates the portables. I can parse any web site for files that match this and download (just like I do for 7zip and notepadplusplus and dozens of other apps).
Rainmeter-4.4-r3349-beta-32bit-portable.zip
Rainmeter-4.4-r3349-beta-64bit-portable.zip
Yincognito wrote: April 28th, 2020, 9:34 am Point is, even if there would be a portable zip available, you'd still have a hard time figuring out which name / file to choose to download, right?
It's incredibly simple and I can show you how. I'll mail you how I do this for notepadplusplus for example if you want. You just parse the html and it's a piece of cake.
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Automate Install and Skin Configuration

Post by Yincognito »

roysubs wrote: April 28th, 2020, 9:47 amIt's incredibly simple and I can show you how. I'll mail you how I do this for notepadplusplus for example if you want. You just parse the html and it's a piece of cake.
No need to - I think I understand now. I told you that I must have missed the obvious, but it's clear to me now that you can either get the last posted link in the HTML source, or the link having the most recent date. No need to parse the actual file names, and even if it was, that wouldn't be so hard either.
CarbonNanotubes
Posts: 1
Joined: May 17th, 2021, 8:16 pm

Re: Automate Install and Skin Configuration

Post by CarbonNanotubes »

I just started looking at this today. I believe I have come up with an option that works. I have tested all the parts individually but not together in a automated script.

Start by setting everything up manually (Install skins and configured them).
Make copies of the skins in the skins folder
Make a copy of Rainmeter.ini located %appdata%\Rainmeter

In your script
1. Install Rainmeter via Chocolatey
2. Quit Rainmeter if open
3. Create directory at root of C:\ for skins (C:\RainmeterSkins for example)
4. Copy the skins into that folder (C:\RainmeterSkins)
5. Replace Rainmeter.ini
6. Start Rainmeter and you should have an identical setup

NOTE: You will need to edit the skins directory in Rainmeter.ini with the location you create in step 3
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Automate Install and Skin Configuration

Post by Yincognito »

CarbonNanotubes wrote: May 17th, 2021, 8:29 pmMake a copy of Rainmeter.ini located %appdata%\Rainmeter
[...]
5. Replace Rainmeter.ini
It's been a while since the last posted replies here so I might have forgotten some details and what I was actually thinking at the time of posting, but isn't copying the entire Rainmeter.ini going to include the settings of other skins than the desired ones in this process? I mean, I'm not sure if you're ok with this, but if you want to replicate the settings of skins A, B and C but you also have D, E and F in Rainmeter.ini, duplicating the latter will set a certain configuation for D, E and F as well ... and if you already have them installed in a different way that might be undesirable.
Post Reply