It is currently December 3rd, 2020, 10:06 am

Variables getting overwritten on install even though Variable file added to package installer

Report bugs with the Rainmeter application and suggest features.
User avatar
mpurses
Posts: 12
Joined: May 12th, 2020, 6:17 pm

Variables getting overwritten on install even though Variable file added to package installer

Post by mpurses »

I'm having an issue with a users custom variables getting lost after upgrading to a newer version of the skin, even though the Variable file(s) are included in the package installer.
Screenshot 2020-11-01 152632.png
You can download my skin here: https://github.com/mpurses/Sonder/releases/download/v2.6.4/Sonder_2.6.4.rmskin

Merge seems to be working okay (and I've tried unchecking that incase it was affecting it, but it still happens.)

You can try changing any custom variables via the settings (quickest would be just changing the accent color). And as soon as you re-install the skin it resets any changed variables to the one in the installer package. Using the latest Rainmeter Beta.
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Posts: 2934
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Variables getting overwritten on install even though Variable file added to package installer

Post by Yincognito »

A somewhat similar issue has been reported by the user SilverAzide a while ago, but it has been fixed. I wonder if there's any connection between the two...but I'd better let the devs investigate this further, if necessary.
User avatar
mpurses
Posts: 12
Joined: May 12th, 2020, 6:17 pm

Re: Variables getting overwritten on install even though Variable file added to package installer

Post by mpurses »

Some further info on what I have tried (nothing has worked so far):

- I messed around with removing blank variables(similar to the issue Yincognito linked) and complicated variables that have unique characters. Just as a shot in the dark, but nothing fixed it.
-I've tried other Variable files (only listing one) and it still overwrites.
-I've tried changing encoding of files, same result of overwriting.
-Other skins that have the option of correctly merging variables are still working correctly as expected for me. It's just my rmskin that I'm creating that isn't working. And I have gotten this to work in the past.

So I'm stumped...
User avatar
SilverAzide
Rainmeter Sage
Posts: 1029
Joined: March 23rd, 2015, 5:26 pm

Re: Variables getting overwritten on install even though Variable file added to package installer

Post by SilverAzide »

mpurses wrote: November 2nd, 2020, 6:58 pm Some further info on what I have tried (nothing has worked so far):

- I messed around with removing blank variables(similar to the issue Yincognito linked) and complicated variables that have unique characters. Just as a shot in the dark, but nothing fixed it.
-I've tried other Variable files (only listing one) and it still overwrites.
-I've tried changing encoding of files, same result of overwriting.
-Other skins that have the option of correctly merging variables are still working correctly as expected for me. It's just my rmskin that I'm creating that isn't working. And I have gotten this to work in the past.

So I'm stumped...
OK, I was curious so I tried installing your skins... Exactly as you reported, my changes to the default settings did not stick after re-installing.

BUT. I noticed one very odd thing. When re-installing, the option to "backup and restore" does NOT back up your skins. If you look in the @Backup folder, the previous installation should be there, but it's not.

I suspect this is the entire problem with the variables; that's just a red herring. Every install is a first install, because there's no backup copy to fetch the original data from. I bet if someone can figure out why the backup is failing, the variables issue should resolve itself.
Gadgets Wiki GitHub More Gadgets...
User avatar
mpurses
Posts: 12
Joined: May 12th, 2020, 6:17 pm

Re: Variables getting overwritten on install even though Variable file added to package installer

Post by mpurses »

SilverAzide wrote: November 2nd, 2020, 11:28 pm OK, I was curious so I tried installing your skins... Exactly as you reported, my changes to the default settings did not stick after re-installing.

BUT. I noticed one very odd thing. When re-installing, the option to "backup and restore" does NOT back up your skins. If you look in the @Backup folder, the previous installation should be there, but it's not.

I suspect this is the entire problem with the variables; that's just a red herring. Every install is a first install, because there's no backup copy to fetch the original data from. I bet if someone can figure out why the backup is failing, the variables issue should resolve itself.
Thanks for confirming that for me.
I believe the not backing up is the correct behavior because I have merge skins option on. But whether I merge or not, it still won't preserve my variables either way. I even stripped down my skin to just one skin ini file and the variable file(also stripped down to the necessities) and it still didn't work. So I really don't know what else I could be missing that could be causing it. Maybe someone could try creating the package on their system to see if its just my Rainmeter setup/system?
User avatar
SilverAzide
Rainmeter Sage
Posts: 1029
Joined: March 23rd, 2015, 5:26 pm

Re: Variables getting overwritten on install even though Variable file added to package installer

Post by SilverAzide »

mpurses wrote: November 3rd, 2020, 12:17 am Thanks for confirming that for me.
I believe the not backing up is the correct behavior because I have merge skins option on. But whether I merge or not, it still won't preserve my variables either way. I even stripped down my skin to just one skin ini file and the variable file(also stripped down to the necessities) and it still didn't work. So I really don't know what else I could be missing that could be causing it. Maybe someone could try creating the package on their system to see if its just my Rainmeter setup/system?
I built a .rmskin from your suite with "Merge skins" checked, and an identical one with "Merge skins" unchecked. Installing the one "with merge" does NOT save any settings, nor does it create a @Backup (just as you stated). Then, installing the one "with no merge" created a backup in @Backup -- AND it preserved my changes. I know this is not what you reported, but it did work for me.

So it seems that the "merge" option won't preserve any variables. It won't even preserve them if there is a @Backup available. I'm not sure if this is a bug or a documentation issue. The docs do not specifically state that a "merge" package will not preserve variables, so it leads one to think that it will, especially since the skin packager UI allows both options to be specified.
Rainmeter 4.4.0.3408 beta (64-bit)
Language: English (1033)
Build time: 2020-10-30 18:34:29
Commit Hash: acdaec34
Windows 10 Pro 2004 64-bit (build 19041) - English (1033)
Gadgets Wiki GitHub More Gadgets...
User avatar
mpurses
Posts: 12
Joined: May 12th, 2020, 6:17 pm

Re: Variables getting overwritten on install even though Variable file added to package installer

Post by mpurses »

SilverAzide wrote: November 3rd, 2020, 1:03 am I built a .rmskin from your suite with "Merge skins" checked, and an identical one with "Merge skins" unchecked. Installing the one "with merge" does NOT save any settings, nor does it create a @Backup (just as you stated). Then, installing the one "with no merge" created a backup in @Backup -- AND it preserved my changes. I know this is not what you reported, but it did work for me.

So it seems that the "merge" option won't preserve any variables. It won't even preserve them if there is a @Backup available. I'm not sure if this is a bug or a documentation issue. The docs do not specifically state that a "merge" package will not preserve variables, so it leads one to think that it will, especially since the skin packager UI allows both options to be specified.
Hmmm.. I'm not sure if this is a good sign or just makes things more confusing...

If I create a skin pacakge on my system with your Gadgets suite, with both merge checked and not checked. Both versions preserve variables for me.
So I know Rainmeter doesn't like something with my skin. It's just really weird how
1) no matter what I can't get variables to preserve on my system with Sonder.
2) You can get them to preserve only if merge is not selected.
3) I (and assume everyone else) can get variables to preserve on a different skin(whether merge is selected or not)
User avatar
SilverAzide
Rainmeter Sage
Posts: 1029
Joined: March 23rd, 2015, 5:26 pm

Re: Variables getting overwritten on install even though Variable file added to package installer

Post by SilverAzide »

This is pretty baffling... the only thing I did was to remove the ".vscode" folder since it's not really needed. :confused:
Gadgets Wiki GitHub More Gadgets...
User avatar
mpurses
Posts: 12
Joined: May 12th, 2020, 6:17 pm

Re: Variables getting overwritten on install even though Variable file added to package installer

Post by mpurses »

I'm now no longer able to get variables to preserve with merge selected on other skins as well (inconsistent behavior on when it happens). So same as you SilverAzide.

Looking at the docs and the code give conflicting info. This says it should preserve...
https://docs.rainmeter.net/tips/advanced-rmskin-options/:
Both Variables files and Merge skins:
One or more .ini (or .inc) files are listed in Variables files, and Merge skins is checked.
Result:
Both actions are done.
Can be used used to change a skin .ini file while leaving existing variable values set by the user unchanged.
Can be used to add lines to a .inc file, while leaving existing variable values set by the user unchanged.

But in the code I don't see where it could preserve variables as I run through it (even though I have gotten it to work before):
https://github.com/rainmeter/rainmeter/blob/acdaec34fa738346c0b2bae75721596b9b1334fb/Library/DialogInstall.cpp#L856

Code: Select all

if (!m_MergeSkins && m_BackupSkins)
{
	KeepVariables();
}
Either way, I need to be able to merge (not delete user created files, because I let them create presets for Themes/Visualizers) AND preserve their variables upon upgrading a skin.

The only thing I can think is happening (not sure because everything seems so inconsistent) is that this happens when a skin has trouble backing up. Sometimes I have skins fail backups for whatever reason. I assume write issues or my Onedrive permissions... But when I step through the code when installing skins there are a lot of file checks happening that are above my knowledge. I see a lot of silent errors or failed checks happening. Idk...
User avatar
SilverAzide
Rainmeter Sage
Posts: 1029
Joined: March 23rd, 2015, 5:26 pm

Re: Variables getting overwritten on install even though Variable file added to package installer

Post by SilverAzide »

mpurses wrote: November 7th, 2020, 5:11 pm The only thing I can think is happening (not sure because everything seems so inconsistent) is that this happens when a skin has trouble backing up. Sometimes I have skins fail backups for whatever reason. I assume write issues or my Onedrive permissions... But when I step through the code when installing skins there are a lot of file checks happening that are above my knowledge. I see a lot of silent errors or failed checks happening. Idk...
Just curious, something I meant to ask you before. Has your Documents folder (usually C:\Users\<username>\Documents) been redirected to OneDrive? The reason I ask is my company recently did some magic jujitsu group policy crap and remapped my Documents folder to a corporate OneDrive folder. A number of apps I use (not only Rainmeter, but stuff like Visual Studio), completely crashed and burned by doing this. Took me days of remapping away from that folder to get things to function again, including changing Rainmeter's default SkinPath.
Gadgets Wiki GitHub More Gadgets...