It is currently September 21st, 2020, 12:51 pm

Run Rainmeter as a Service

Get help with installing and using Rainmeter.
User avatar
jsmorley
Developer
Posts: 21376
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Run Rainmeter as a Service

Post by jsmorley »

Yincognito wrote: August 11th, 2020, 12:37 pm Yeah, I thought it would though. :confused: Especially since the path to Rainmeter was a part of the bang.
Rainmeter has the ability, put in back in the EARLIEST days, to be started with a defined, alternative location and name of "Rainmeter.ini", the file that controls pretty much everything. So when Rainmeter is started, it isn't looking for bangs on the command line. If there are ANY parameters at all on the command line when it is first started, those are treated as a location of that alternative Rainmeter.ini, and yeah, you can get some very strange behavior, since it will not only "look for" that alternative Rainmeter.ini, but if it isn't found, it will treat that as an order to start Rainmeter with a brand-new, user defined Rainmeter.ini, and that file, with a vanilla setup, will be created.

It gets particularly ugly, since that is going to create that file in the same folder as Rainmeter.exe, and when you have a "standard" installation, there won't be any Skins folder, and Rainmeter is just going to pitch a fit.

It's all a bit murky to me, since it hasn't really been used in like forever, it was originally designed back in the dawn of time when Rainmeter was closely integrated with Samurize. I recommend that command line parameters never be used unless Rainmeter is running, when the parameters will be passed to the running application, parsed, and executed.

At some point we should revisit this. I tend to agree that when command line parameters are passed to Rainmeter.exe, it should behave the same if Rainmeter is running, or not running. That entire "alternative" Rainmeter.ini deal is a pointless prehensile-tail, and only complicates that. At the most generous, this thing could perhaps be justified when there wasn't any concept of Layout, and you might want to load a different setup depending on some external factor. I can't see any point for it now.
User avatar
Yincognito
Posts: 2565
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Run Rainmeter as a Service

Post by Yincognito »

jsmorley wrote: August 11th, 2020, 12:44 pm Rainmeter has the ability, put in back in the EARLIEST days, to be started with a defined, alternative location and name of "Rainmeter.ini", the file that controls pretty much everything. So when Rainmeter is started, it isn't looking for bangs on the command line. If there are ANY parameters at all on the command line when it is first started, those are treated as a location of that alternative Rainmeter.ini, and yeah, you can get some very strange behavior, since it will not only "look for" that alternative Rainmeter.ini, but if it isn't found, it will treat that as an order to start Rainmeter with a brand-new, user defined Rainmeter.ini, and that file, with a vanilla setup, will be created.

It gets particularly ugly, since that is going to create that file in the same folder as Rainmeter.exe, and when you have a "standard" installation, there won't be any Skins folder, and Rainmeter is just going to pitch a fit.

It's all a bit murky to me, since it hasn't really been used in like forever, it was originally designed back in the dawn of time when Rainmeter was closely integrated with Samurize. I recommend that command line parameters never be used unless Rainmeter is running, when the parameters will be passed to the running application, parsed, and executed.

At some point we should revisit this. I tend to agree that when command line parameters are passed to Rainmeter.exe, it should behave the same if Rainmeter is running, or not running. That entire "alternative" Rainmeter.ini deal is a pointless prehensile-tail, and only complicates that. At the most generous, this thing could perhaps be justified when there wasn't any concept of Layout, and you might want to load a different setup depending on some external factor. I can't see any point for it now.
Yes, that was what probably happened. I was not in any way bothered by the fact that there were folders created in the Rainmeter installation folder by that, as that most likely was my fault placing the quotes in a certain way, when trying to make the thing work. In the end, I probably expected Rainmeter to behave just like any other program when a ["Program" "Parameter"] bang is executed, that is run the program itself, even if it wasn't already started. But then I realized there is no other way to instruct Rainmeter to do something from the command line other than placing the full path of it along with the bang parameters.

Just a bit of misunderstanding of the command line syntax vs Rainmeter's own bang syntax - it was easy to have that happening since the manual didn't imply that these bangs only work if Rainmeter is running (or I didn't look in the right places, maybe, having checked only the first paragraphs here and here). To further perpetuate this confusion, commands such as ["C:\Program Files\Rainmeter\Rainmeter.exe" !LoadLayout "Test"] that are explained here appeared to work even if Rainmeter isn't running, so I assumed the other such commands / bangs / whatever (like ["C:\Program Files\Rainmeter\Rainmeter.exe" !ActivateConfig "Test" "Test.ini"]) will too. :confused: