Old 11th November 2015, 13:09   #1
pld32
Junior Member
 
Join Date: Apr 2008
Posts: 15
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.
pld32 is offline   Reply With Quote
Old 11th November 2015, 18:27   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,521
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...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th November 2015, 12:56   #3
pld32
Junior Member
 
Join Date: Apr 2008
Posts: 15
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 is offline   Reply With Quote
Old 11th December 2015, 15:19   #4
pld32
Junior Member
 
Join Date: Apr 2008
Posts: 15
Still need help please

I can not get the install button to be enabled?

I changed from using InstallDirRegKey to set $INSTDIR. to this..
Quote:
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.
Attached Thumbnails
Click image for larger version

Name:	Snap 2015-12-11 at 11.16.08.png
Views:	197
Size:	20.7 KB
ID:	52128  
Attached Files
File Type: nsi NewReports.nsi (4.2 KB, 92 views)
pld32 is offline   Reply With Quote
Old 11th December 2015, 15:28   #5
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
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.
demiller9 is offline   Reply With Quote
Old 11th December 2015, 15:47   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,521
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 11th December 2015, 16:56   #7
pld32
Junior Member
 
Join Date: Apr 2008
Posts: 15
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.
pld32 is offline   Reply With Quote
Old 11th December 2015, 18:01   #8
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,521
Open a command prompt as administrator, use net.exe to map a drive letter and then start the installer from this prompt...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 14th December 2015, 12:09   #9
pld32
Junior Member
 
Join Date: Apr 2008
Posts: 15
Thumbs up 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.
pld32 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump