- NSIS Discussion
- WriteRegStr Problem
Archive: WriteRegStr Problem
ukandrewc
20th March 2011 14:29 UTC
WriteRegStr Problem
I have a weird problem with this entry, causing the installer to freeze:
WriteRegStr HKLM "Software\Microsoft\Internet Explorer\Extensions\{5ABDF6B0-336E-41e8-ADF2-76629F963BD6}" "MenuText" "Queue Sales Records"
This entry works OK.
WriteRegStr HKLM "SOFTWARE\Microsoft\Internet Explorer\Low Rights\ElevationPolicy\{ED1FA840-C3FD-11dd-AB02-00045A7930B1}" "Policy" "3"
An additional oddity is that if OutFile is install.exe I get the problem, if it is setup.exe I don't.
Anyone got any ideas?
Thanks
Andrew
ukandrewc
20th March 2011 15:44 UTC
I have just discovered that this is only on XP. On Windows 7 they both freeze the installer.
Afrow UK
20th March 2011 16:04 UTC
Do you have RequestExecutionLevel admin?
Stu
ukandrewc
20th March 2011 16:28 UTC
Thanks Stu
I do now but it hasn't changed anything.
I thought I'd write to a .reg file and run that but I would need to escape \ characters in file names.
ukandrewc
20th March 2011 16:40 UTC
It's definitely to do with the braces as removing them fixes it.
I suspect a problem in the string parser but don't know why that wouldn't have cropped up before?
ukandrewc
20th March 2011 17:12 UTC
In fact just removing the right brace solves it.
Any ideas?
Thanks
ukandrewc
20th March 2011 17:23 UTC
It seems that it is interfering with the execution. The value is written and if I put MessageBox MB_OK "Hello" straight after, the system beeps, the message box shows and then freezes.
ukandrewc
20th March 2011 17:26 UTC
Definitely something in the string parser, if I change the Key from ...\Extensions\{... to ...\Extension\{... it works.
Anders
20th March 2011 21:53 UTC
OutFile test.exe
RequestExecutionLevel admin
page instfiles
Section
WriteRegStr HKLM "Software\Microsoft\Internet Explorer\Extensions\{5ABDF6B0-336E-41e8-ADF2-76629F963BD6}" "MenuText" "Queue Sales Records"
>SectionEnd
>
Does this crash?
ukandrewc
21st March 2011 10:54 UTC
Thanks Anders
Unfortunately no. I've tried it in isolation but it doesn't cause any problem.
I'll do some more tests.
ukandrewc
21st March 2011 11:04 UTC
I think I'll have to leave this for the moment. If I remove everything except the WriteRegStr lines from the installer, it works OK.
I've now got a workaround by writing to a .reg file but at some pount I'll go through and see what combination causes the problem.
Thanks
Afrow UK
21st March 2011 14:30 UTC
You could also try putting the key in a variable. Either way it shouldn't crash so yeh when you get back to it it'll be nice to find out what is causing it. I've never seen this problem.
Stu
ukandrewc
22nd March 2011 23:44 UTC
I have discovered that removing this:
SetOverwrite ifnewer
SetOutPath $SYSDIR
File "SystemCpy\*.*"
and replacing them with calls to InstallLib removes the problem.
But I simply haven't been able to reproduce this in isolation.
ukandrewc
23rd March 2011 00:51 UTC
Forgot to mention that the important line is SetOutPath, if that isn't set to $SYSDIR everything works.
The DLL's being in use or not when I installed didn't seem relevant.