INF CopyFiles Directive - Copy Cursors To Non-Default Folder

I'm using this INF template that installs cursors to "C:\Windows" using the DIRID 10. My problem is that I want to install the cursors on "C:\NonSystemFolder" (ideally using %SystemDrive%).

I used a shortened version of the template to test the absolute path DIRID, and tried to pass the environment variable %SystemDrive% to it so that it would copy my file in the system drive (with no folder). What it actually did was creating a folder named "%SystemDrive%" on the current path and putting my file inside that folder.

[Version]
signature="$CHICAGO$"
[DefaultInstall]
CopyFiles = Scheme.Cur
[DestinationDirs]
Scheme.Cur = -1,"MyCursors"
[Scheme.Cur]
Working In Background.ani

I checked the non-exhaustive list of DIRIDs that Microsoft provides in their site, but aside from -1 (absolute path) any other ID than seems to describe what would work for me. As mentioned previously, though, the -1 ID doesn't do what I assumed it would.

1 Answer

So I re-read Microsoft documentation of the DIRIDs and found out that DIRID 24 was exactly what I was looking for. The description had a rather odd wording, so at first I disregarded it as the right one to use.

Here is the revised INF template for a custom folder at the system drive (usually "C:"). In order for it to be used for your specific cursors you need to change the File names under [Scheme.Cur] and [Strings]. Comments were added to make it easier.

[Version]
signature="$CHICAGO$"
[DefaultInstall]
; DIRID 24 is used throughout the file. That is the same as %SystemDrive%.
; Lines starting with semicolons are comments and are here just to help with editing.
CopyFiles = Scheme.Cur, Scheme.Txt
AddReg = Scheme.Reg
[DestinationDirs]
Scheme.Cur = 24,"%CUR_DIR%"
Scheme.Txt = 24,"%CUR_DIR%"
[Scheme.Reg]
; Don't mess with this!
HKCU,"Control Panel\Cursors\Schemes","%SCHEME_NAME%",,"%24%\%CUR_DIR%\%pointer%,%24%\%CUR_DIR%\%help%,%24%\%CUR_DIR%\%workback%,%24%\%CUR_DIR%\%busy%,%24%\%CUR_DIR%\%cross%,%24%\%CUR_DIR%\%Text%,%24%\%CUR_DIR%\%handwrt%,%24%\%CUR_DIR%\%unavailiable%,%24%\%CUR_DIR%\%Vert%,%24%\%CUR_DIR%\%Horz%,%24%\%CUR_DIR%\%Dgn1%,%24%\%CUR_DIR%\%Dgn2%,%24%\%CUR_DIR%\%move%,%24%\%CUR_DIR%\%alternate%,%24%\%CUR_DIR%\%link%"
[Scheme.txt]
; Put here text files that you want to copy to the folder containing your cursors.
; READ ME.txt ;<-sample
[Scheme.Cur]
; Here goes the list of file names of your cursors. Order is irrelevant.
aero_arrow.cur
aero_helpsel.cur
aero_working.ani
aero_busy.ani
aero_select.cur
aero_unavail.cur
aero_ns.cur
aero_ew.cur
aero_nwse.cur
aero_nesw.cur
aero_move.cur
aero_link.cur
aero_cross.cur
aero_pen.cur
aero_up.cur
[Strings]
; This is the relative folder where cursors are going to be copied.
CUR_DIR = "MyCursors\Windows Aero"
; This is the name of your Scheme. The one that will show up in Mouse Properties
SCHEME_NAME = "Windows Aero"
; All the names within quotation marks MUST MATCH with the file names in Scheme.Cur. String names to the left should match equivalent cursors in the right.
pointer = "aero_arrow.cur"
help = "aero_helpsel.cur"
workback = "aero_working.ani"
busy = "aero_busy.ani"
text = "aero_select.cur"
unavailiable = "aero_unavail.cur"
vert = "aero_ns.cur"
horz = "aero_ew.cur"
;dgn1 is the one going from top-left to bottom-right
dgn1 = "aero_nwse.cur"
;dgn2 is the one going from top-right to bottom-left
dgn2 = "aero_nesw.cur"
move = "aero_move.cur"
link = "aero_link.cur"
;cross or precision selection
cross = "aero_cross.cur"
handwrt = "aero_pen.cur"
alternate = "aero_up.cur"

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like