Skip to content
⌘ NSIS Forum Archive

InstallDirRegKey not working in Windows 10

9 posts

pld32#

InstallDirRegKey not working in Windows 10

NSIS V2.46

I use InstallDirRegKey HKCU "Software\MayorsCourt\Paths" "Application".

I use defaults for
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH

The destination Folder is blank when run on Windows 10? On prior versions no issues.

I have run also as admin.

I also noticed that if you click the browse button to select the destination location that NO mapped drivers are shown and no access to network drives.
Anders#
You usually don't use InstallDirRegKey without InstallDir, using both will make sure that $InstDir will never be empty.

No matter what you do, InstallDirRegKey will not work the first time you run your setup on a new machine because the value will not be there.

Is this Win10 machine 64-bit? You should use Process Monitor from SysInternals/Microsoft and see if setup is accessing the correct key. If "Software\MayorsCourt\Paths" is written to the 64-bit part of the registry then InstallDirRegKey will not work and you have to create your own manual version in .onInit with SetRegView...
pld32#
Thanks for reply.

I understand the first two paragraphs. This is an issue with existing client I have had for years

This is a Win 10 64-bit pc.

The application is a 32-bit Visual Foxpro Application. We useWin32API to perform the registry.

Any other suggestions? This was working fine on a 64-bit windows 7 and windows 8 versions?
pld32#
Still need help please

I can not get the install button to be enabled?

I changed from using InstallDirRegKey to set $INSTDIR. to this..
Function .onInit
System::Call 'kernel32::CreateMutex(i 0, i 0, t "MCReportUpdateMutex") ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK "The installer is already running."
Abort
ReadRegStr $INSTDIR HKCU "Software\MAYCOURT\Paths" "Application"
FunctionEnd
I get the correct directory now in the destination folder textbox when the screen "Choose Install Location" is displayed, the destination folder is selected/highlighted, and the Install button is disabled?

I attached my code.
demiller9#
You mentioned in your first post that there were no drives mapped when you use the browse button. Is L: a mapped drive? The Install button will be disabled if the path is bad (drive not mapped).

I'm guessing the user maps the L: drive, but the installer is running as Administrator, not as that user.
Anders#
https://blogs.msdn.microsoft.com/cja...windows-vista/ indicates that there is some sort of compatibility shim that could fix the mapped drives behind your back but I have never seen it working in real life situations.
pld32#
My pc is now windows 10.
The example is from my pc and I have a mapped L: drive.
NSIS browse button does not show any mapped drives and I have 8 or so. I can see them in windows explorer via "This PC" in win10.

I have full access to all drives and folders.

I have tried to run as admin but same results.
Anders#
Open a command prompt as administrator, use net.exe to map a drive letter and then start the installer from this prompt...
pld32#
WorkAround

Thanks for the suggestion but that will not work for production/clients.

I believe my only solution at this point is to use the UNC and not a mapped drive. I tested using UNC. Windows10 and NSIS seem happy with this approach.