It is currently May 3rd, 2024, 9:57 am

I had an idea. But is it a good one?

Get help with installing and using Rainmeter.
User avatar
Virginityrocks
Posts: 478
Joined: February 26th, 2011, 10:22 pm

I had an idea. But is it a good one?

Post by Virginityrocks »

I just conceived an idea that hatched in my brain but I don't know what to think of it yet. One thing that I don't really like about Rainmeter is that I come out with new versions of my skin constantly, making new slight revisions, bug fixes or adding/changing features. I'm thinking there must be a way (or should be a way) for the ini information of each skin to be entirely online. That is, whenever the skin loads, it loads it from a specific website, ie "www.MYWEBSITE.com/Skins/MySkin/TheSkin.ini". When I change the skin online, it also changes it to each person using my skin around the world on their next Rainmeter load.

Possible? Impossible? Adding new images would be impossible without downloading the new content, but small changes to the INI file is plausible, wouldn't it be?
Droptop Four
Dropdown menu bar & app launcher for Windows & Rainmeter
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: I had an idea. But is it a good one?

Post by moshi »

i think the idea is bad.

it would be possible to do it though. (images would be even easier, look at any skin that downloads an image from the internet).

to start you have to create a skin.ini in your skin's folder. it should look like this:

Code: Select all

[Variables]
Stage=1

[Stage]
@Include="#CURRENTPATH#DownloadFile\skin#Stage#.inc"
in the skin's folder you create a new folder called DownloadFile. in this folder you create a file called skin1.inc. it should look like this:

Code: Select all

[MeasureDownload]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateDivider=-1
Url="www.MYWEBSITE.com/Skins/MySkin/TheSkin.ini"
Debug=1
StringIndex=1
DecodeCharacterReference=0
FinishAction=[!WriteKeyValue Variables "Stage" "2" "#CURRENTPATH#skin.ini"][!Refresh "#CURRENTCONFIG#"]
DynamicVariables=1
Download=1
DownloadFile=skin2.inc
in your online file put this measure:

Code: Select all

[MeasureDownload]
Measure=Calc
Formula=1
UpdateDivider=-1
DynamicVariables=1
IfAboveValue=0
IfAboveAction=[!WriteKeyValue Variables "Stage" "1" "#CURRENTPATH#skin.ini"]
User avatar
Virginityrocks
Posts: 478
Joined: February 26th, 2011, 10:22 pm

Re: I had an idea. But is it a good one?

Post by Virginityrocks »

Well, what about a button that is itself a skin, that compares your skin's version number to a number specified in the online skin, if the number is higher than the other, it shows string "Update available", in which case, if pressed, will download all of the new content, including images, and will overwrite the old content (somehow?), after which time the doors will close and it will not constantly re-download the information each time you use Rainmeter, and use local content until "Update available" is pressed again?

Actually, I suppose an easier and more effective route would be to compare the version number, then "Update available" simply takes you to the new .RMSKIN file. But how can I make Rainmeter compare the skin's version number to a number on a website? Can I just use @Include to reference a .INC file on the web?

ie @include=http://www.MYWEBSITE.com/files/versionnumber.inc
Droptop Four
Dropdown menu bar & app launcher for Windows & Rainmeter
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: I had an idea. But is it a good one?

Post by Kaelri »

Virginityrocks wrote:Well, what about a button that is itself a skin, that compares your skin's version number to a number specified in the online skin, if the number is higher than the other, it shows string "Update available", in which case, if pressed, will download all of the new content, including images, and will overwrite the old content (somehow?), after which time the doors will close and it will not constantly re-download the information each time you use Rainmeter, and use local content until "Update available" is pressed again?

Actually, I suppose an easier and more effective route would be to compare the version number, then "Update available" simply takes you to the new .RMSKIN file. But how can I make Rainmeter compare the skin's version number to a number on a website? Can I just use @Include to reference a .INC file on the web?

ie @include=http://www.MYWEBSITE.com/files/versionnumber.inc
Something like this:

Code: Select all

[Variables]
SkinVersion=1.0

[MeasureVersion]
Measure=Plugin
Plugin=WebParser
Url=http://...
UpdateRate=3600
RegExp=(?siU)<version>(.*)</version>
StringIndex=1
FinishAction=!EnableMeasure MeasureVersionCheck

[MeasureVersionCheck]
Measure=Calc
Formula=MeasureVersion - #SkinVersion#
IfAboveValue=0
IfAboveAction=[!SetOption MeterName Text "An update is available!"]
Disabled=1
Then, on your site, have a file like "version.txt" that simply contains, for example:

Code: Select all

<version>1.1</version>
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: I had an idea. But is it a good one?

Post by MerlinTheRed »

One way to do this would be via git or another version control system like Mercurial or Bazaar. Your users would have to have that installed though. Those programs allow you to keep track of changes to a remote repository, check if there are newer versions available and download them. It's a heavy dependency for a single skin but you wouldn't have to worry about comparing version numbers and the like, only executing shell commands and parsing the output...
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
Virginityrocks
Posts: 478
Joined: February 26th, 2011, 10:22 pm

Re: I had an idea. But is it a good one?

Post by Virginityrocks »

I couldnt really have anything that requires extra work by the user. Everything should work out of the box, which is why I really like the idea of having online variables.

What I'll do is have a .txt or .xml file that uses regexp to get both a version number of the most recent release, and another that references the download link, in case that changes. I may also find other uses for this trick.
Droptop Four
Dropdown menu bar & app launcher for Windows & Rainmeter