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

[Suggestion] Prevent Skins folder from installing to the OneDrive directory or Network Location

Report bugs with the Rainmeter application and suggest features.
Post Reply
User avatar
Cariboudjan
Posts: 260
Joined: May 12th, 2019, 8:55 am

[Suggestion] Prevent Skins folder from installing to the OneDrive directory or Network Location

Post by Cariboudjan »

Some novice users are reporting issues with Rainmeter skins and performance issues because their PCs are placing the Skins folder in the OneDrive\Documents directory instead of the local Documents folder.

Any way to prevent OneDrive or a Network Location from being the default when Rainmeter is installed?
User avatar
Jeff
Posts: 326
Joined: September 3rd, 2018, 11:18 am

Re: [Suggestion] Prevent Skins folder from installing to the OneDrive directory or Network Location

Post by Jeff »

I was thinking about making the same post too, we have over 100+ messages (of which 34 are mine telling people to edit SkinPath) in the #help channel on Discord telling people to change the SkinPath from OneDrive to another folder which dosen't have problems

Since Windows 10+ sadly forces OneDrive as the default location (unless you don't have internet or a Microsoft account or pirated it), I was thinking a solution would be just to create another setting in the Settings tab to select the folder, looking at OPENFILENAMEA or W, I don't see a way to make the dialogue only work with folders though.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: [Suggestion] Prevent Skins folder from installing to the OneDrive directory or Network Location

Post by SilverAzide »

Where's the "+1" button so I can mash it a bajillion times?

Unfortunately, I'm not sure if there is a simple fix for this. My guess is that the installer is calling the Win32 SHGetFolderPath API to get the path to the user's "Documents" folder, which could be anywhere. (It is one of the "known folders" in Windows.) I doubt there is a good way to know that whatever path that is being returned is one that has been hijacked by an app to point to some cloudy location.
User avatar
Cariboudjan
Posts: 260
Joined: May 12th, 2019, 8:55 am

Re: [Suggestion] Prevent Skins folder from installing to the OneDrive directory or Network Location

Post by Cariboudjan »

Just force the SkinPath location on Standard Installation to be "C:\%USERNAME%\Documents\" instead of referencing the "Default" Documents location?
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: [Suggestion] Prevent Skins folder from installing to the OneDrive directory or Network Location

Post by SilverAzide »

Cariboudjan wrote: January 28th, 2023, 10:33 pm Just force the SkinPath location on Standard Installation to be "C:\%USERNAME%\Documents\" instead of referencing the "Default" Documents location?
It would actually need to be %USERPROFILE%, not %USERNAME%, but even then there is no guarantee that %USERPROFILE% hasn't been taken over either. A lot of companies have corporate OneDrives that move everything to OneDrive folders (Documents, Pictures, even the freakin' Desktop) so backup and recovery (and WFH) can be simplified. And corporate OneDrives can be locked down with policies so you can't turn it off or change what folders are synced.

installing Rainmeter skins in a OneDrive folder isn't necessarily a problem. As long as you UN-check the default "Files on Demand" option (i.e., turn off the "Save space and download files as you need them", which is turned on by default) and/or right-click the Documents or Documents\Rainmeter folder and select "Always keep on this device", it should work in theory. If you log into multiple machines, you'll get your Rainmeter files synced on both, which is either really cool or super annoying, depending on how you like things.
User avatar
Cariboudjan
Posts: 260
Joined: May 12th, 2019, 8:55 am

Re: [Suggestion] Prevent Skins folder from installing to the OneDrive directory or Network Location

Post by Cariboudjan »

Running this script will fix the OneDrive problem. Copy/paste to command prompt.

Code: Select all

@echo off & "C:\Program Files\Rainmeter\Rainmeter.exe" !WriteKeyValue Rainmeter SkinPath "C:\Users\%USERNAME%\Documents\Rainmeter\Skins\" "%APPDATA%\Rainmeter\Rainmeter.ini" & taskkill /f /im "Rainmeter.exe" & xcopy /s /e /y /f /i "C:\Users\%USERNAME%\OneDrive\Documents\Rainmeter\Skins" "C:\Users\%USERNAME%\Documents\Rainmeter\Skins" & timeout 1 & start "" "C:\Program Files\Rainmeter\Rainmeter.exe" & exit
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Suggestion] Prevent Skins folder from installing to the OneDrive directory or Network Location

Post by Yincognito »

I can't test this since I have a habit of uninstalling and disabling all kinds of crapware pushed on my throat without my permission the following second after installing Windows, so I might miss some other actions needed, but...
  • if before installing Rainmeter, either unload and uninstall OneDrive (if the permissions and policies permit it, as SilverAzide mentioned), or run regedit.exe to navigate at HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders and set the folders of significance (roughly, the Personal value one, though could be others too) to the desired %USERPROFILE%\Documents or similar, if by any chance they are redirections to OneDrive locations. Alternatively, you can do it from PowerShell via Get-KnownFolderPath and Set-KnownFolderPath as alluded by SilverAzide, or from the command line via (" handles spaces in values, "" and ^% make sure spacing and percent symbols are treated properly):

    Code: Select all

    REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" /t "REG_EXPAND_SZ" /d ""^%USERPROFILE^%\Documents"" /f
    User Shell Folders.jpg
  • if after installing Rainmeter and already subject to OneDrive redirections, Cariboudjan's command line should do it, if by any chance you don't know how to do those things yourself (i.e. correcting the SkinPath value in your Rainmeter.ini, followed by moving the Skins folder from the OneDrive location to the default one)
That being said, without being confronted with this issue in the first place... is the Skins folder the only one whose location is problematic in this scenario, or there might be cases when other Rainmeter locations like Layout or Plugins are of concern? :???:
Post Reply