diff --git a/Examples/makensis.nsi b/Examples/makensis.nsi
index 03850045..2872b8c9 100644
--- a/Examples/makensis.nsi
+++ b/Examples/makensis.nsi
@@ -1,7 +1,7 @@
;NSIS Setup Script
!define VER_MAJOR 2
-!define VER_MINOR 0b1
+!define VER_MINOR 0b2
;--------------------------------
;Configuration
@@ -31,7 +31,7 @@ InstallDirRegKey HKLM SOFTWARE\NSIS ""
;Modern UI Configuration
!define MUI_PRODUCT "NSIS"
- !define MUI_VERSION "2.0b1"
+ !define MUI_VERSION "2.0b2 (CVS)"
!define MUI_NAME "Nullsoft Install System ${MUI_VERSION}" ;Installer name
@@ -137,14 +137,20 @@ Section "NSI Development Shell Extensions" SecExtention
WriteRegStr HKCR ".nsi" "backup_val" $1
Label1:
WriteRegStr HKCR ".nsh" "" "NSHFile"
- WriteRegStr HKCR "NSHFile" "" "NSIS Header File"
- WriteRegStr HKCR "NSHFile\shell" "" "open"
- WriteRegStr HKCR "NSHFile\DefaultIcon" "" $INSTDIR\makensisw.exe,1
+ ReadRegStr $0 HKCR "NSHFile" ""
+ StrCmp $0 "" 0 skipNSIAssoc
+ WriteRegStr HKCR "NSHFile" "" "NSIS Header File"
+ WriteRegStr HKCR "NSHFile\shell" "" "open"
+ WriteRegStr HKCR "NSHFile\DefaultIcon" "" $INSTDIR\makensisw.exe,1
+ skipNSHAssoc:
WriteRegStr HKCR "NSHFile\shell\open\command" "" 'notepad.exe "%1"'
WriteRegStr HKCR ".nsi" "" "NSISFile"
- WriteRegStr HKCR "NSISFile" "" "NSIS Script File"
- WriteRegStr HKCR "NSISFile\shell" "" "open"
- WriteRegStr HKCR "NSISFile\DefaultIcon" "" $INSTDIR\makensisw.exe,1
+ ReadRegStr $0 HKCR "NSISFile" ""
+ StrCmp $0 "" 0 skipNSIAssoc
+ WriteRegStr HKCR "NSISFile" "" "NSIS Script File"
+ WriteRegStr HKCR "NSISFile\shell" "" "open"
+ WriteRegStr HKCR "NSISFile\DefaultIcon" "" $INSTDIR\makensisw.exe,1
+ skipNSIAssoc:
WriteRegStr HKCR "NSISFile\shell\open\command" "" 'notepad.exe "%1"'
WriteRegStr HKCR "NSISFile\shell\compile" "" "Compile NSI"
WriteRegStr HKCR "NSISFile\shell\compile\command" "" '"$INSTDIR\makensisw.exe" "%1"'
diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c
index f180f474..3183242e 100644
--- a/Source/exehead/exec.c
+++ b/Source/exehead/exec.c
@@ -52,7 +52,7 @@ static WIN32_FIND_DATA * NSISCALL file_exists(char *buf)
static LONG NSISCALL myRegDeleteKeyEx(HKEY thiskey, LPCTSTR lpSubKey, int onlyifempty)
{
HKEY key;
- int retval=RegOpenKeyEx(thiskey,lpSubKey,0,KEY_ALL_ACCESS,&key);
+ int retval=RegOpenKeyEx(thiskey,lpSubKey,0,KEY_WRITE,&key);
if (retval==ERROR_SUCCESS)
{
// NB - don't change this to static (recursive function)
@@ -1158,7 +1158,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
if (!parm3)
{
HKEY hKey;
- if (RegOpenKeyEx((HKEY)rootkey,buf3,0,KEY_ALL_ACCESS,&hKey) == ERROR_SUCCESS)
+ if (RegOpenKeyEx((HKEY)rootkey,buf3,0,KEY_WRITE,&hKey) == ERROR_SUCCESS)
{
char *buf0=process_string_fromparm_tobuf(0x02);
log_printf4("DeleteRegValue: %d\\%s\\%s",rootkey,buf3,buf0);
diff --git a/Source/makenssi.cpp b/Source/makenssi.cpp
index bcc4e383..b5174638 100644
--- a/Source/makenssi.cpp
+++ b/Source/makenssi.cpp
@@ -1,4 +1,4 @@
-const char *NSIS_VERSION="v2.0b1";
+const char *NSIS_VERSION="v2.0b2 (CVS)";
/*
Nullsoft "SuperPimp" Installation System - makensis.cpp - installer compiler code
diff --git a/Source/script.cpp b/Source/script.cpp
index c5131448..3674e826 100644
--- a/Source/script.cpp
+++ b/Source/script.cpp
@@ -1304,7 +1304,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
if (k == -1) PRINTHELP()
SCRIPT_MSG("XPStyle: %s\n", line.gettoken_str(1));
init_res_editor();
- char* szXPManifest = k ? 0 : "Nullsoft Install System v2.0b1";
+ char* szXPManifest = k ? 0 : "Nullsoft Install System v2.0b2 (CVS)";
res_editor->UpdateResource(MAKEINTRESOURCE(24), MAKEINTRESOURCE(1), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), (unsigned char*)szXPManifest, k ? 0 : lstrlen(szXPManifest));
}
catch (exception& err) {