jason-jxc / FontReg

FontReg.exe is intended as a replacement for Microsoft's outdated fontinst.exe
35 stars 7 forks source link

Not able to run FontReg.exe on CMD in windows 2019 #3

Open DivyaWal7 opened 5 months ago

DivyaWal7 commented 5 months ago

I have installed the FontReg.exe at path C:\

and running command icacls C:/FontReg.exe
gives following permissions. 
BUILTIN\Administrators:(I)(F) NT AUTHORITY\SYSTEM:(I)(F) BUILTIN\Users:(I)(RX)

dockerfile

 FROM mcr.microsoft.com/windows/servercore:ltsc2019

# Copy FontReg.exe to C:\FontReg.exe
COPY FontReg.exe C:/FontReg.exe

# Set the working directory
WORKDIR C:/

# Give read and execute permissions to the Users group (optional)
RUN icacls C:/FontReg.exe /grant BUILTIN\Users:(RX)

# Switch to a non-privileged user (optional)
USER ContainerUser

# Run FontReg.exe
CMD ["powershell", "-Command", "Start-Process C:/FontReg.exe -Wait"]

This code works in windows 11 , and if run the file inside container and all the fonts gets registered. However in case of windows 2019 this does not work, I have tried to give permissions to the file and path as well as the user, still nothing works.

`# Take ownership of the file
 takeown /f C:\FontReg.exe



Grant full control to the file

icacls C:\FontReg.exe /grant Everyone:F

 icacls C:\ /grant ContainerAdministrator:F /T
Start-process C:\FontReg.exe -wait `

1) is there any addiitonal dependency that is required in windows 2019. 2) even in case of windows , why there is a need to register fonts at container start. If i write RUN FontReg.exe inside dockerfile to simply register fonts at build time, nothing works. The same works when making the container up.

Suggestions, help is required.

DivyaWal7 commented 4 months ago

Can anyone assist herre ?