Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install under Windows user account doesn't work #137

Closed
fblais opened this issue Mar 31, 2023 · 9 comments
Closed

Install under Windows user account doesn't work #137

fblais opened this issue Mar 31, 2023 · 9 comments

Comments

@fblais
Copy link

fblais commented Mar 31, 2023

Hi.
Windows 10 Pro here.
Have trouble installing this to user account.
I'm entering the admin password when prompted, it "seems" to install, but then the theme is not visible in the list.
Rebooting didn't help.
Thanks for looking at this!

P.S. Install on admin account is no problem.

@ful1e5
Copy link
Owner

ful1e5 commented Apr 7, 2023

Have you tried the option "Run as administrator" by right-clicking on the install script?

@fblais
Copy link
Author

fblais commented Apr 7, 2023

Yes, it's then that I'm prompted for the admin password, etc. like described in the firt post.

@ful1e5
Copy link
Owner

ful1e5 commented Sep 19, 2023

I'm not a Windows user, but someone in the community can help you with this issue.

@fblais
Copy link
Author

fblais commented Sep 19, 2023

Thanks.
Still waiting for this help to show up. :)

Regards.

@stanio
Copy link
Contributor

stanio commented Sep 22, 2023

The install.inf script copies the cursor files into the system directory (C:\Windows\Cursors or more generally %SYSTEMROOT%\Cursors), so it asks for administrative privileges. The custom cursor themes are otherwise installed/defined for the current user – see the registry keys:

  • HKCU\Control Panel\Cursors
  • HKCU\Control Panel\Cursors\Schemes

It seems your user cannot elevate a process (via UAC) as administrator but runs with a different (administrator) user, so it sets up the cursors just for that user.

You may:

  • Manually define a cursor theme by selecting the individual cursors ("Browse..."):

    mouse-pointers

    then "Save As..." a theme with a name of your choice. You may use the files already copied to %SYSTEMROOT%\Cursors\Bibata...; or

  • Export the HKCU\Control Panel\Cursors registry tree from the administrator that has installed the cursors previously, and import it to your user.

If one doesn't have any administrative privileges, they may extract the cursors into their profile, f.e. %LOCALAPPDATA%\Microsoft\Windows\Cursors, and use the first approach suggested above. Dunno if the install.inf could do this by default.

@fblais
Copy link
Author

fblais commented Sep 22, 2023

Thanks Stanio!
I copied the cursors to my user appadata folder, then choosed the individual cursors one by one and saved that into a Bibata theme with success, thanks again!

@stanio
Copy link
Contributor

stanio commented Mar 11, 2024

If one doesn't have any administrative privileges, they may extract the cursors into their profile... Dunno if the install.inf could do this by default.

Saving this here for future reference – yes, it is possible:

  • Using Dirids (INF Files, Windows Driver Installation):

    Value Destination Directory
    10 Windows directory.
    This is equivalent to %SystemRoot%.
    53 User profile directory

The user profile (home) directory is equivalent to %USERPROFILE%. So something like:

 [DestinationDirs]
-Scheme.Cur = 10,"%CUR_DIR%"
+Scheme.Cur = 53,"%CUR_DIR%"

 [Scheme.Reg]
-HKCU,"Control Panel\Cursors\Schemes","%SCHEME_NAME%",,"%10%\%CUR_DIR%\...,%10%\%CUR_DIR%\...,..."
+HKCU,"Control Panel\Cursors\Schemes","%SCHEME_NAME%",,"%53%\%CUR_DIR%\...,%53%\%CUR_DIR%\...,..."

 [Strings]
-CUR_DIR             = "Cursors\Bibata-..."
+CUR_DIR             = "AppData\Local\Cursors\Bibata-..."

However, given INF files are primarily meant for device driver installation, it seems Windows will ask for elevated rights anyway. In this regard, install.inf is probably not the best tool for installing mouse cursors for a single user, while it is a convenient built-in facitlity to do so. An install.bat doing series of copy and reg add commands, instead of the INF CopyFiles and AddReg directives, may be better – just like the current uninstall.bat. It would require more work for someone to write one.

From Reg - Edit Registry - Windows CMD (SS64.com):

Elevation

Unlike REGEDIT, REG.exe does not always require elevation
When adding an item to HKCU, REG will be automatically manifested “asInvoker”, and will work without elevation,
when adding an item to HKLM then it does need to be run elevated.

@stanio
Copy link
Contributor

stanio commented Mar 15, 2024

Saving this here for future reference – yes, it is possible...

However, I've identified an unpleasant shortcoming related to (what it seems) the "user profile preloading" Windows feature. Haven't tried if it occurs with that feature disabled (if possible?) but I've noticed after a system restart the mouse cursors are not applied on the login screen. They are not applied even after login until one opens the "Mouse Properties" control panel and clicks "OK" to the already selected mouse pointer scheme.

This all appears related to the fact the "Mouse Properties" control panel automatically replaces paths under the user profile with %USERPROFILE%\... prefix:

> reg query "HKCU\Control Panel\Cursors" /s

and I speculate this fails to resolve before the actual login. After login, the user profile preloading has already set the cursor scheme while failing to resolve the cursor files.

I've also noticed the new (Windows 10+) "Accessibility > Mouse pointer" (Change pointer size and color) settings – they dynamically generate cursor (bitmap) files from SVG sources into %USERPROFILE%\AppData\Local\Microsoft\Windows\Cursors but they appear to update the Registry with full paths:

C:\Users\<user>\AppData\...

and that doesn't suffer from the given problem.

@stanio
Copy link
Contributor

stanio commented Sep 12, 2024

However, I've identified an unpleasant shortcoming related to (what it seems) the "user profile preloading" Windows feature...

In this regard, I recommend copying the files to a subdirectory of C:\ProgramData (%ProgramData%), for example: C:\ProgramData\Cursors\Bibata. The %ProgramData% directory's default permissions for users are to create new files and subdirectories, gaining full control over the newly created files/directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants