From c8c7fb018174ac377c5bad2e50f2f873790d5cf0 Mon Sep 17 00:00:00 2001 From: "SND\\air_max_cp" Date: Fri, 9 Dec 2011 16:55:38 +0000 Subject: [PATCH 1/7] [test] fixed typo in _run_pykdtest.cmd git-svn-id: https://pykd.svn.codeplex.com/svn@72152 9b283d60-5439-405e-af05-b73fd8c4d996 --- test/scripts/_run_pykdtest.cmd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/scripts/_run_pykdtest.cmd b/test/scripts/_run_pykdtest.cmd index c9dbcbe..c8b0c14 100644 --- a/test/scripts/_run_pykdtest.cmd +++ b/test/scripts/_run_pykdtest.cmd @@ -16,8 +16,7 @@ set PythonRegKey=HKLM\Software\Python\PythonCore\2.6\InstallPath set RegSwitch=64 if "%TestAppPlatform%"=="Win32" set RegSwitch=32 -for /F "tokens=3*" %%A in ('reg.exe query %PythonRegKey% /ve /reg:%RegSwitch% 2^>NUL ^| FIND "REG_SZ"') do set PythonInstallPath=%%B -::echo %PythonInstallPath% +for /F "tokens=3*" %%A in ('reg.exe query %PythonRegKey% /ve /reg:%RegSwitch% 2^>NUL ^| FIND "REG_SZ"') do set PythonInstallPath=%%A %PythonInstallPath%python.exe "%~dp0pykdtest.py" %TestAppPath% From 69da8abdc91d1bf7716900b9088189c75a140330 Mon Sep 17 00:00:00 2001 From: "SND\\air_max_cp" Date: Fri, 16 Dec 2011 16:03:39 +0000 Subject: [PATCH 2/7] added: boost build command line script [0.1.x] refactored: DbgPythonPath class [0.1.x] added: FileExists function [0.0.x] refactored: DbgPythonPath class [0.0.x] added: FileExists function git-svn-id: https://pykd.svn.codeplex.com/svn@72409 9b283d60-5439-405e-af05-b73fd8c4d996 --- _boost_pykd_build.cmd | 26 ++++++++ pykd/dbgext.cpp | 3 +- pykd/dbgpath.cpp | 152 +++++++++++------------------------------- pykd/dbgpath.h | 21 ++---- pykd/utils.h | 9 +++ 5 files changed, 78 insertions(+), 133 deletions(-) create mode 100644 _boost_pykd_build.cmd create mode 100644 pykd/utils.h diff --git a/_boost_pykd_build.cmd b/_boost_pykd_build.cmd new file mode 100644 index 0000000..283ea23 --- /dev/null +++ b/_boost_pykd_build.cmd @@ -0,0 +1,26 @@ +:: +:: Copy to boost root dir +:: + +call :ExecBjam 32 +call :ExecBjam 64 +pause +goto :EOF + + +:ExecBjam +set arch=%1 +set stagedir=stage +if "%arch%"=="64" set stagedir=stage64 + +bjam.exe ^ + -j 4 ^ + --toolset=msvc-9.0 ^ + release debug ^ + threading=multi link=static runtime-link=shared ^ + address-model=%arch% ^ + --with-python --with-date_time --with-regex --with-thread ^ + python=2.6 ^ + --stagedir=%stagedir% ^ + stage +goto :EOF diff --git a/pykd/dbgext.cpp b/pykd/dbgext.cpp index e75d0bf..d1ed286 100644 --- a/pykd/dbgext.cpp +++ b/pykd/dbgext.cpp @@ -844,11 +844,10 @@ py( PDEBUG_CLIENT4 client, PCSTR args) // найти путь к файлу std::string fullFileName; - std::string filePath; DbgPythonPath dbgPythonPath; - if ( dbgPythonPath.findPath( argsList[0], fullFileName, filePath ) ) + if ( dbgPythonPath.getFullFileName( argsList[0], fullFileName ) ) { try { diff --git a/pykd/dbgpath.cpp b/pykd/dbgpath.cpp index 10be731..f2094b7 100644 --- a/pykd/dbgpath.cpp +++ b/pykd/dbgpath.cpp @@ -1,147 +1,71 @@ #include "stdafx.h" #include "dbgpath.h" +#include "utils.h" #include /////////////////////////////////////////////////////////////////////////////// - - DbgPythonPath::DbgPythonPath() { - DWORD enviromentSize = 0; - - enviromentSize = GetEnvironmentVariableA( "PYTHONPATH", NULL, enviromentSize ); + boost::python::object sys = boost::python::import("sys"); - std::vector enviromentBuffer(enviromentSize); + boost::python::list pathList(sys.attr("path")); - if (!enviromentBuffer.empty()) - { - GetEnvironmentVariableA( "PYTHONPATH", &enviromentBuffer[0], enviromentSize ); - - typedef boost::escaped_list_separator char_separator_t; - typedef boost::tokenizer< char_separator_t > char_tokenizer_t; - - std::string pytonPath( &enviromentBuffer[0] ); - - char_tokenizer_t token( pytonPath, char_separator_t( "", "; \t", "\"" ) ); - - for ( char_tokenizer_t::iterator it = token.begin(); it != token.end(); ++it ) - { - if ( *it != "" ) - m_pathList.push_back( *it ); - } - } -} - -/////////////////////////////////////////////////////////////////////////////// - -std::string -DbgPythonPath::getStr() const -{ - std::string str; - std::vector::const_iterator it = m_pathList.begin(); - - for ( ; it != m_pathList.end(); ++it ) - { - str += *it; - str += ";"; - } - - return str; -} - -/////////////////////////////////////////////////////////////////////////////// - -bool -DbgPythonPath::findPath( - const std::string &fileName, - std::string &fullFileName, - std::string &filePath ) const -{ - std::vector< std::string > extPathList; - - boost::python::object sys = boost::python::import( "sys"); - - boost::python::list pathList( sys.attr("path") ); - boost::python::ssize_t n = boost::python::len(pathList); - for(boost::python::ssize_t i=0;i( pathList[i] ) ); - bool pyExt = fileName.rfind( ".py" ) == fileName.length() - 3; + for (boost::python::ssize_t i = 0; i < n ; i++) + m_extactedPathList.push_back(boost::python::extract(pathList[i])); +} - // 1. Ищем в рабочей директории - DWORD bufSize = - SearchPathA( - NULL, - fileName.c_str(), - pyExt ? NULL : ".py", - 0, - NULL, - NULL ); - - if ( bufSize > 0 ) - { - bufSize += 1; - std::vector fullFileNameCStr(bufSize); - char *partFileNameCStr = NULL; +/////////////////////////////////////////////////////////////////////////////// + +bool DbgPythonPath::getFullFileName(const std::string &fileName, std::string &fullFileName) const +{ + bool fileHasPyExt = fileName.rfind(".py") == fileName.length() - 3; + fullFileName = fileName; - SearchPathA( - NULL, - fileName.c_str(), - pyExt ? NULL : ".py", - bufSize, - &fullFileNameCStr[0], - &partFileNameCStr ); - - fullFileName = std::string( &fullFileNameCStr[0] ); - if ( !fullFileName.empty() ) - { - filePath = std::string( &fullFileNameCStr[0], partFileNameCStr ); - return true; - } - } - - // 2. Ищем во всех директориях, указанных в m_pathList + if (!fileHasPyExt) + fullFileName += ".py"; - std::vector::const_iterator it = extPathList.begin(); - - for ( ; it != extPathList.end(); ++it ) + if (FileExists(fullFileName.c_str())) + return true; + + std::vector::const_iterator it = m_extactedPathList.begin(); + for ( ; it != m_extactedPathList.end(); ++it) { - DWORD bufSize = - SearchPathA( - (*it).c_str(), - fileName.c_str(), - pyExt ? NULL : ".py", - 0, - NULL, - NULL ); + DWORD bufSize = SearchPathA( + (*it).c_str(), + fullFileName.c_str(), + NULL, + 0, + NULL, + NULL); - if ( bufSize > 0 ) + if (bufSize > 0) { bufSize += 1; std::vector fullFileNameCStr(bufSize); - char *partFileNameCStr = NULL; + char *partFileNameCStr = NULL; bufSize = SearchPathA( (*it).c_str(), - fileName.c_str(), - pyExt ? NULL : ".py", + fullFileName.c_str(), + NULL, bufSize, &fullFileNameCStr[0], - &partFileNameCStr ); - - fullFileName = std::string( &fullFileNameCStr[0] ); - if ( !fullFileName.empty() ) - { - filePath = std::string( &fullFileNameCStr[0], partFileNameCStr ); + &partFileNameCStr); + + if (bufSize > 0) + { + fullFileName = std::string(&fullFileNameCStr[0]); return true; - } + } } } - + + fullFileName = ""; return false; } diff --git a/pykd/dbgpath.h b/pykd/dbgpath.h index 3f790f1..56e4cbe 100644 --- a/pykd/dbgpath.h +++ b/pykd/dbgpath.h @@ -1,32 +1,19 @@ #pragma once #include +#include /////////////////////////////////////////////////////////////////////////////// class DbgPythonPath { public: - DbgPythonPath(); - std::string - getStr() const; - - bool - findPath( - const std::string &fileName, - std::string &fullFileName, - std::string &filePath ) const; - - + bool getFullFileName(const std::string &fileName, std::string &fullFileName) const; + private: - - std::vector< std::string > m_pathList; - + std::vector m_extactedPathList; }; -//extern DbgPythonPath& dbgPythonPath; - - /////////////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/pykd/utils.h b/pykd/utils.h new file mode 100644 index 0000000..77bc24a --- /dev/null +++ b/pykd/utils.h @@ -0,0 +1,9 @@ +#pragma once + +//////////////////////////////////////////////////////////////////////////////// +inline +bool FileExists(LPCSTR lpFileName) +{ + return ::GetFileAttributesA(lpFileName) != DWORD(-1); +} +//////////////////////////////////////////////////////////////////////////////// From b09d6c56e227cb781fa2d393660803aac2f8986c Mon Sep 17 00:00:00 2001 From: "SND\\air_max_cp" Date: Mon, 26 Dec 2011 10:42:39 +0000 Subject: [PATCH 3/7] setup: 1.x compatibility setup: DIA registration setup: remember installed components for uninstaller setup: version increment git-svn-id: https://pykd.svn.codeplex.com/svn@72699 9b283d60-5439-405e-af05-b73fd8c4d996 --- setup/pykd_setup_common.nsh | 108 +++++++++++++++++++++++++++++++----- setup/pykd_setup_x64.nsi | 3 + setup/pykd_setup_x86.nsi | 3 + 3 files changed, 100 insertions(+), 14 deletions(-) diff --git a/setup/pykd_setup_common.nsh b/setup/pykd_setup_common.nsh index 0f28456..fdd0095 100644 --- a/setup/pykd_setup_common.nsh +++ b/setup/pykd_setup_common.nsh @@ -27,7 +27,7 @@ SetCompressor LZMA !define PRODUCT_SHORT_NAME "pykd" !define PRODUCT_FULL_NAME "Python extension for WinDbg" -!define PRODUCT_VERSION "0.0.0.20" +!define PRODUCT_VERSION "0.0.1.2" !define PRODUCT_URL "http://pykd.codeplex.com/" !define PRODUCT_NAME_AND_VERSION "${PRODUCT_FULL_NAME} ${PRODUCT_ARCH} ${PRODUCT_VERSION}" !define PRODUCT_MANUFACTURER "PyKd Team" @@ -111,7 +111,7 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${PRODUCT_SHORT_NAME}" VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "${PRODUCT_NAME_AND_VERSION}" VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${PRODUCT_MANUFACTURER}" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "${PRODUCT_SHORT_NAME} is a trademark of ${PRODUCT_MANUFACTURER}" -VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© All rights reserved 2010-2011" +VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© All rights reserved 2010-2012" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${PRODUCT_SHORT_NAME} setup" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${PRODUCT_VERSION}" @@ -140,7 +140,6 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${PRODUCT_VERSION}" Pop $_LOGICLIB_TEMP !insertmacro _== $_LOGICLIB_TEMP 1 `${_t}` `${_f}` !macroend - !define IsVcRuntimeInstalled `"" IsVcRuntimeInstalled ""` !define un.IsVcRuntimeInstalled `"" IsVcRuntimeInstalled ""` @@ -155,6 +154,16 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${PRODUCT_VERSION}" !define IsPythonInstalled `"" IsPythonInstalled ""` !define un.IsPythonInstalled `"" IsPythonInstalled ""` +!macro _IsDiaRegistered _a _b _t _f + !insertmacro _LOGICLIB_TEMP + ${SetRegView64} + ReadRegStr $_LOGICLIB_TEMP HKCR "CLSID\${CLSID_DiaSource}\InprocServer32" "" + ${SetRegView32} + !insertmacro _!= $_LOGICLIB_TEMP "" `${_t}` `${_f}` +!macroend +!define IsDiaRegistered `"" IsDiaRegistered ""` +!define un.IsDiaRegistered `"" IsDiaRegistered ""` + #------------------------------------------------------------------------------ # Check WinDbg executable presence in selected directory #------------------------------------------------------------------------------ @@ -204,11 +213,12 @@ Section "Python ${PYTHON_VERSION} ${PRODUCT_ARCH}" sec_python ${If} $0 == "OK" DetailPrint "Successfully downloaded." DetailPrint "Installing Python..." - IfErrors ClearErrorFlag1 - ClearErrorFlag1: ExecWait '"msiexec" /i "$TEMP\${PYTHON_INSTALLER}"' IfErrors PythonInstallFailed DetailPrint "Successfully installed." + ${SetRegView64} + WriteRegDWORD HKLM "Software\${PRODUCT_SHORT_NAME}" "UninstallPython" 1 + ${SetRegView32} ${Else} PythonInstallFailed: DetailPrint "Operation failed. Installation will be continued without Python." @@ -226,15 +236,34 @@ Section "Visual C++ 2005 SP1 (${PRODUCT_ARCH}) runtime" sec_vcruntime !else File "..\Release\vcredist_${PRODUCT_ARCH}.exe" !endif - + ExecWait "$TEMP\vcredist_${PRODUCT_ARCH}.exe" - IfErrors RuntimeInstallFailed - DetailPrint "Successfully installed." - Return + ${IfNot} ${Errors} + DetailPrint "Successfully installed." + ${SetRegView64} + WriteRegDWORD HKLM "Software\${PRODUCT_SHORT_NAME}" "UninstallVcRuntime" 1 + ${SetRegView32} + ${Else} + DetailPrint "Operation failed. Installation will be continued without Visual C++ runtime." + DetailPrint "Please download and install it manually." + ${EndIf} +SectionEnd - RuntimeInstallFailed: - DetailPrint "Operation failed. Installation will be continued without Visual C++ runtime." - DetailPrint "Please download and install it manually." +Section "Debug Interface Access (${PRODUCT_ARCH}) library" sec_msdia + DetailPrint "Registering Debug Interface Access (${PRODUCT_ARCH}) library..." + !if ${PRODUCT_ARCH} == "x64" + RegDLL "$COMMONFILES64\Microsoft Shared\VC\${MSDIA_DLL_NAME}" + !else + RegDLL "$COMMONFILES32\Microsoft Shared\VC\${MSDIA_DLL_NAME}" + !endif + ${IfNot} ${Errors} + DetailPrint "Successfully registered." + ${SetRegView64} + WriteRegDWORD HKLM "Software\${PRODUCT_SHORT_NAME}" "UnregisterDia" 1 + ${SetRegView32} + ${Else} + DetailPrint "Operation failed. Please register it manually." + ${EndIf} SectionEnd Section -FinishSection @@ -295,6 +324,11 @@ Function .onInit !insertmacro UnselectSection ${sec_vcruntime} SectionSetText ${sec_vcruntime} "" ${EndIf} + + ${If} ${IsDiaRegistered} + !insertmacro UnselectSection ${sec_msdia} + SectionSetText ${sec_msdia} "" + ${EndIf} FunctionEnd #------------------------------------------------------------------------------ @@ -305,12 +339,14 @@ LangString DESC_sec_pykd ${LANG_ENGLISH} "${PRODUCT_FULL_NAME}" LangString DESC_sec_snippets ${LANG_ENGLISH} "Useful code snippets. Will be installed in $DOCUMENTS\${PRODUCT_SHORT_NAME}" LangString DESC_sec_python ${LANG_ENGLISH} "Let installer download and setup Python ${PYTHON_VERSION} ${PRODUCT_ARCH}" LangString DESC_sec_vcruntime ${LANG_ENGLISH} "Let installer download and setup Microsoft Visual C++ 2005 SP1 (${PRODUCT_ARCH}) runtime library" +LangString DESC_sec_msdia ${LANG_ENGLISH} "Let installer register Debug Interface Access (${PRODUCT_ARCH}) library" !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${sec_pykd} $(DESC_sec_pykd) !insertmacro MUI_DESCRIPTION_TEXT ${sec_snippets} $(DESC_sec_snippets) !insertmacro MUI_DESCRIPTION_TEXT ${sec_python} $(DESC_sec_python) !insertmacro MUI_DESCRIPTION_TEXT ${sec_vcruntime} $(DESC_sec_vcruntime) + !insertmacro MUI_DESCRIPTION_TEXT ${sec_msdia} $(DESC_sec_msdia) !insertmacro MUI_FUNCTION_DESCRIPTION_END #------------------------------------------------------------------------------ @@ -346,11 +382,30 @@ Section /o "un.Python ${PYTHON_VERSION} ${PRODUCT_ARCH}" unsec_python ExecWait '"msiexec" /x ${PYTHON_PRODUCT_CODE}' SectionEnd +Section /o "un.Debug Interface Access (${PRODUCT_ARCH}) library" unsec_msdia + DetailPrint "Unregistering Debug Interface Access (${PRODUCT_ARCH}) library..." + ${SetRegView64} + ReadRegStr $R0 HKCR "CLSID\${CLSID_DiaSource}\InprocServer32" "" + ${SetRegView32} + UnRegDLL $R0 +SectionEnd + Section /o "un.Visual C++ 2005 SP1 (${PRODUCT_ARCH}) runtime" unsec_vcruntime DetailPrint "Uninstalling Microsoft Visual C++ 2005 SP1 (${PRODUCT_ARCH}) runtime library..." ExecWait '"msiexec" /x ${VCRUNTIME_PRODUCT_CODE}' SectionEnd +Section -un.FinishSection + ${SetRegView64} + WriteRegDWORD HKLM "Software\${PRODUCT_SHORT_NAME}" "UninstallPython" 0 + WriteRegDWORD HKLM "Software\${PRODUCT_SHORT_NAME}" "UnregisterDia" 0 + WriteRegDWORD HKLM "Software\${PRODUCT_SHORT_NAME}" "UninstallVcRuntime" 0 +# DeleteRegValue HKLM "Software\${PRODUCT_SHORT_NAME}" "UninstallPython" +# DeleteRegValue HKLM "Software\${PRODUCT_SHORT_NAME}" "UnregisterDia" +# DeleteRegValue HKLM "Software\${PRODUCT_SHORT_NAME}" "UninstallVcRuntime" + ${SetRegView32} +SectionEnd + #------------------------------------------------------------------------------ # Before first page displayed #------------------------------------------------------------------------------ @@ -360,12 +415,35 @@ SectionEnd !define WinSxS_HasAssembly `Call un.WinSxS_HasAssembly` Function un.onInit - ${IfNot} ${IsPythonInstalled} + ${SetRegView64} + ReadRegDWORD $R0 HKLM "Software\${PRODUCT_SHORT_NAME}" "UninstallPython" + ${SetRegView32} + + ${If} ${Errors} + ${OrIf} $R0 == 0 + ${OrIfNot} ${IsPythonInstalled} !insertmacro UnselectSection ${unsec_python} SectionSetText ${unsec_python} "" ${EndIf} - ${IfNot} ${IsVcRuntimeInstalled} + ${SetRegView64} + ReadRegDWORD $R0 HKLM "Software\${PRODUCT_SHORT_NAME}" "UnregisterDia" + ${SetRegView32} + + ${If} ${Errors} + ${OrIf} $R0 == 0 + ${OrIfNot} ${IsDiaRegistered} + !insertmacro UnselectSection ${unsec_msdia} + SectionSetText ${unsec_msdia} "" + ${EndIf} + + ${SetRegView64} + ReadRegDWORD $R0 HKLM "Software\${PRODUCT_SHORT_NAME}" "UninstallVcRuntime" + ${SetRegView32} + + ${If} ${Errors} + ${OrIf} $R0 == 0 + ${OrIfNot} ${IsVcRuntimeInstalled} !insertmacro UnselectSection ${unsec_vcruntime} SectionSetText ${unsec_vcruntime} "" ${EndIf} @@ -377,10 +455,12 @@ FunctionEnd LangString DESC_unsec_pykd ${LANG_ENGLISH} "${PRODUCT_FULL_NAME}" LangString DESC_unsec_python ${LANG_ENGLISH} "Uninstall Python ${PYTHON_VERSION} ${PRODUCT_ARCH}" +LangString DESC_unsec_msdia ${LANG_ENGLISH} "Unregister Debug Interface Access (${PRODUCT_ARCH}) library" LangString DESC_unsec_vcruntime ${LANG_ENGLISH} "Uninstall Microsoft Visual C++ 2005 SP1 (${PRODUCT_ARCH}) runtime library" !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${unsec_pykd} $(DESC_unsec_pykd) !insertmacro MUI_DESCRIPTION_TEXT ${unsec_python} $(DESC_unsec_python) + !insertmacro MUI_DESCRIPTION_TEXT ${unsec_msdia} $(DESC_unsec_msdia) !insertmacro MUI_DESCRIPTION_TEXT ${unsec_vcruntime} $(DESC_unsec_vcruntime) !insertmacro MUI_UNFUNCTION_DESCRIPTION_END diff --git a/setup/pykd_setup_x64.nsi b/setup/pykd_setup_x64.nsi index 76521ef..1226769 100644 --- a/setup/pykd_setup_x64.nsi +++ b/setup/pykd_setup_x64.nsi @@ -12,4 +12,7 @@ # When changing VC runtime vesion don't forget to update ProductCode appropriately !define VCRUNTIME_PRODUCT_CODE "{ad8a2fa1-06e7-4b0d-927d-6e54b3d31028}" +!define MSDIA_DLL_NAME "msdia90.dll" +!define CLSID_DiaSource "{4C41678E-887B-4365-A09E-925D28DB33C2}" + !include "pykd_setup_common.nsh" diff --git a/setup/pykd_setup_x86.nsi b/setup/pykd_setup_x86.nsi index 5b19973..971389b 100644 --- a/setup/pykd_setup_x86.nsi +++ b/setup/pykd_setup_x86.nsi @@ -12,4 +12,7 @@ # When changing VC runtime vesion don't forget to update ProductCode appropriately !define VCRUNTIME_PRODUCT_CODE "{710f4c1c-cc18-4c49-8cbf-51240c89a1a2}" +!define MSDIA_DLL_NAME "msdia90.dll" +!define CLSID_DiaSource "{4C41678E-887B-4365-A09E-925D28DB33C2}" + !include "pykd_setup_common.nsh" From 3f73f116693578185738dc29c367b6d7c047f2a5 Mon Sep 17 00:00:00 2001 From: "SND\\air_max_cp" Date: Mon, 26 Dec 2011 16:39:36 +0000 Subject: [PATCH 4/7] setup: 1.x fixed Visual C++ runtime dependency to VS 2008 git-svn-id: https://pykd.svn.codeplex.com/svn@72702 9b283d60-5439-405e-af05-b73fd8c4d996 --- setup/pykd_setup_common.nsh | 18 +++++++++--------- setup/pykd_setup_x64.nsi | 3 ++- setup/pykd_setup_x86.nsi | 3 ++- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/setup/pykd_setup_common.nsh b/setup/pykd_setup_common.nsh index fdd0095..8a8642a 100644 --- a/setup/pykd_setup_common.nsh +++ b/setup/pykd_setup_common.nsh @@ -134,8 +134,8 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${PRODUCT_VERSION}" !macro _IsVcRuntimeInstalled _a _b _t _f !insertmacro _LOGICLIB_TEMP - Push 'msvcr80.dll' - Push 'Microsoft.VC80.CRT,version="8.0.50727.6195",type="win32",processorArchitecture="${ARCH}",publicKeyToken="1fc8b3b9a1e18e3b"' + Push 'msvcr90.dll' + Push 'Microsoft.VC90.CRT,version="9.0.21022.8",type="win32",processorArchitecture="${ARCH}",publicKeyToken="1fc8b3b9a1e18e3b"' ${WinSxS_HasAssembly} Pop $_LOGICLIB_TEMP !insertmacro _== $_LOGICLIB_TEMP 1 `${_t}` `${_f}` @@ -227,8 +227,8 @@ Section "Python ${PYTHON_VERSION} ${PRODUCT_ARCH}" sec_python ${EndIf} SectionEnd -Section "Visual C++ 2005 SP1 (${PRODUCT_ARCH}) runtime" sec_vcruntime - DetailPrint "Installing Microsoft Visual C++ 2005 SP1 (${PRODUCT_ARCH}) runtime library..." +Section "Visual C++ 2008 SP1 (${PRODUCT_ARCH}) runtime" sec_vcruntime + DetailPrint "Installing Microsoft Visual C++ 2008 SP1 (${PRODUCT_ARCH}) runtime library..." SetOutPath "$TEMP" !if ${PRODUCT_ARCH} == "x64" @@ -255,7 +255,7 @@ Section "Debug Interface Access (${PRODUCT_ARCH}) library" sec_msdia RegDLL "$COMMONFILES64\Microsoft Shared\VC\${MSDIA_DLL_NAME}" !else RegDLL "$COMMONFILES32\Microsoft Shared\VC\${MSDIA_DLL_NAME}" - !endif + !endif ${IfNot} ${Errors} DetailPrint "Successfully registered." ${SetRegView64} @@ -338,7 +338,7 @@ FunctionEnd LangString DESC_sec_pykd ${LANG_ENGLISH} "${PRODUCT_FULL_NAME}" LangString DESC_sec_snippets ${LANG_ENGLISH} "Useful code snippets. Will be installed in $DOCUMENTS\${PRODUCT_SHORT_NAME}" LangString DESC_sec_python ${LANG_ENGLISH} "Let installer download and setup Python ${PYTHON_VERSION} ${PRODUCT_ARCH}" -LangString DESC_sec_vcruntime ${LANG_ENGLISH} "Let installer download and setup Microsoft Visual C++ 2005 SP1 (${PRODUCT_ARCH}) runtime library" +LangString DESC_sec_vcruntime ${LANG_ENGLISH} "Let installer download and setup Microsoft Visual C++ 2008 SP1 (${PRODUCT_ARCH}) runtime library" LangString DESC_sec_msdia ${LANG_ENGLISH} "Let installer register Debug Interface Access (${PRODUCT_ARCH}) library" !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN @@ -390,8 +390,8 @@ Section /o "un.Debug Interface Access (${PRODUCT_ARCH}) library" unsec_msdia UnRegDLL $R0 SectionEnd -Section /o "un.Visual C++ 2005 SP1 (${PRODUCT_ARCH}) runtime" unsec_vcruntime - DetailPrint "Uninstalling Microsoft Visual C++ 2005 SP1 (${PRODUCT_ARCH}) runtime library..." +Section /o "un.Visual C++ 2008 SP1 (${PRODUCT_ARCH}) runtime" unsec_vcruntime + DetailPrint "Uninstalling Microsoft Visual C++ 2008 SP1 (${PRODUCT_ARCH}) runtime library..." ExecWait '"msiexec" /x ${VCRUNTIME_PRODUCT_CODE}' SectionEnd @@ -456,7 +456,7 @@ FunctionEnd LangString DESC_unsec_pykd ${LANG_ENGLISH} "${PRODUCT_FULL_NAME}" LangString DESC_unsec_python ${LANG_ENGLISH} "Uninstall Python ${PYTHON_VERSION} ${PRODUCT_ARCH}" LangString DESC_unsec_msdia ${LANG_ENGLISH} "Unregister Debug Interface Access (${PRODUCT_ARCH}) library" -LangString DESC_unsec_vcruntime ${LANG_ENGLISH} "Uninstall Microsoft Visual C++ 2005 SP1 (${PRODUCT_ARCH}) runtime library" +LangString DESC_unsec_vcruntime ${LANG_ENGLISH} "Uninstall Microsoft Visual C++ 2008 SP1 (${PRODUCT_ARCH}) runtime library" !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${unsec_pykd} $(DESC_unsec_pykd) diff --git a/setup/pykd_setup_x64.nsi b/setup/pykd_setup_x64.nsi index 1226769..9e23cbe 100644 --- a/setup/pykd_setup_x64.nsi +++ b/setup/pykd_setup_x64.nsi @@ -10,7 +10,8 @@ !define PYTHON_PRODUCT_CODE "{6151CF20-0BD8-4023-A4A0-6A86DCFE58E6}" # When changing VC runtime vesion don't forget to update ProductCode appropriately -!define VCRUNTIME_PRODUCT_CODE "{ad8a2fa1-06e7-4b0d-927d-6e54b3d31028}" +# VC9 (VS2008) SP1 + MFC Security Update +!define VCRUNTIME_PRODUCT_CODE "{5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4}" !define MSDIA_DLL_NAME "msdia90.dll" !define CLSID_DiaSource "{4C41678E-887B-4365-A09E-925D28DB33C2}" diff --git a/setup/pykd_setup_x86.nsi b/setup/pykd_setup_x86.nsi index 971389b..11d3237 100644 --- a/setup/pykd_setup_x86.nsi +++ b/setup/pykd_setup_x86.nsi @@ -10,7 +10,8 @@ !define PYTHON_PRODUCT_CODE "{6151CF20-0BD8-4023-A4A0-6A86DCFE58E5}" # When changing VC runtime vesion don't forget to update ProductCode appropriately -!define VCRUNTIME_PRODUCT_CODE "{710f4c1c-cc18-4c49-8cbf-51240c89a1a2}" +# VC9 (VS2008) SP1 + MFC Security Update +!define VCRUNTIME_PRODUCT_CODE "{9BE518E6-ECC6-35A9-88E4-87755C07200F}" !define MSDIA_DLL_NAME "msdia90.dll" !define CLSID_DiaSource "{4C41678E-887B-4365-A09E-925D28DB33C2}" From bfc7292dafc86bcd518c478c03ab1c1e2c6446fb Mon Sep 17 00:00:00 2001 From: "SND\\air_max_cp" Date: Mon, 26 Dec 2011 16:59:46 +0000 Subject: [PATCH 5/7] setup: 1.x fixed error flag clean before Python setup git-svn-id: https://pykd.svn.codeplex.com/svn@72703 9b283d60-5439-405e-af05-b73fd8c4d996 --- setup/pykd_setup_common.nsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/pykd_setup_common.nsh b/setup/pykd_setup_common.nsh index 8a8642a..84df580 100644 --- a/setup/pykd_setup_common.nsh +++ b/setup/pykd_setup_common.nsh @@ -136,7 +136,7 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${PRODUCT_VERSION}" !insertmacro _LOGICLIB_TEMP Push 'msvcr90.dll' Push 'Microsoft.VC90.CRT,version="9.0.21022.8",type="win32",processorArchitecture="${ARCH}",publicKeyToken="1fc8b3b9a1e18e3b"' - ${WinSxS_HasAssembly} + ${WinSxS_HasAssembly} Pop $_LOGICLIB_TEMP !insertmacro _== $_LOGICLIB_TEMP 1 `${_t}` `${_f}` !macroend @@ -213,6 +213,7 @@ Section "Python ${PYTHON_VERSION} ${PRODUCT_ARCH}" sec_python ${If} $0 == "OK" DetailPrint "Successfully downloaded." DetailPrint "Installing Python..." + ClearErrors ExecWait '"msiexec" /i "$TEMP\${PYTHON_INSTALLER}"' IfErrors PythonInstallFailed DetailPrint "Successfully installed." From 9a5801ab45b3447e376bcfcc19eb8bc971653de0 Mon Sep 17 00:00:00 2001 From: "SND\\air_max_cp" Date: Thu, 29 Dec 2011 09:02:06 +0000 Subject: [PATCH 6/7] setup: fix DIA registration/unregistration for x64 setup: version increment git-svn-id: https://pykd.svn.codeplex.com/svn@72756 9b283d60-5439-405e-af05-b73fd8c4d996 --- setup/pykd_setup_common.nsh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/setup/pykd_setup_common.nsh b/setup/pykd_setup_common.nsh index 84df580..ce7ba33 100644 --- a/setup/pykd_setup_common.nsh +++ b/setup/pykd_setup_common.nsh @@ -27,7 +27,7 @@ SetCompressor LZMA !define PRODUCT_SHORT_NAME "pykd" !define PRODUCT_FULL_NAME "Python extension for WinDbg" -!define PRODUCT_VERSION "0.0.1.2" +!define PRODUCT_VERSION "0.1.0.3" !define PRODUCT_URL "http://pykd.codeplex.com/" !define PRODUCT_NAME_AND_VERSION "${PRODUCT_FULL_NAME} ${PRODUCT_ARCH} ${PRODUCT_VERSION}" !define PRODUCT_MANUFACTURER "PyKd Team" @@ -252,11 +252,16 @@ SectionEnd Section "Debug Interface Access (${PRODUCT_ARCH}) library" sec_msdia DetailPrint "Registering Debug Interface Access (${PRODUCT_ARCH}) library..." + !if ${PRODUCT_ARCH} == "x64" - RegDLL "$COMMONFILES64\Microsoft Shared\VC\${MSDIA_DLL_NAME}" + ${DisableX64FSRedirection} + ClearErrors + ExecWait '"$SYSDIR\regsvr32.exe" /s "$COMMONFILES64\Microsoft Shared\VC\${MSDIA_DLL_NAME}"' + ${EnableX64FSRedirection} !else - RegDLL "$COMMONFILES32\Microsoft Shared\VC\${MSDIA_DLL_NAME}" + RegDLL "$COMMONFILES\Microsoft Shared\VC\${MSDIA_DLL_NAME}" !endif + ${IfNot} ${Errors} DetailPrint "Successfully registered." ${SetRegView64} @@ -388,7 +393,15 @@ Section /o "un.Debug Interface Access (${PRODUCT_ARCH}) library" unsec_msdia ${SetRegView64} ReadRegStr $R0 HKCR "CLSID\${CLSID_DiaSource}\InprocServer32" "" ${SetRegView32} - UnRegDLL $R0 + + !if ${PRODUCT_ARCH} == "x64" + ${DisableX64FSRedirection} + ClearErrors + ExecWait '"$SYSDIR\regsvr32.exe" /s /u "$R0"' + ${EnableX64FSRedirection} + !else + UnRegDLL $R0 + !endif SectionEnd Section /o "un.Visual C++ 2008 SP1 (${PRODUCT_ARCH}) runtime" unsec_vcruntime From e29909cabb878b7f4bfaab5f7b4f9bf8a3409bfa Mon Sep 17 00:00:00 2001 From: "SND\\air_max_cp" Date: Sun, 20 May 2012 08:55:15 +0000 Subject: [PATCH 7/7] setup: 1.x install samples and snippets setup: 1.x version increment git-svn-id: https://pykd.svn.codeplex.com/svn@76457 9b283d60-5439-405e-af05-b73fd8c4d996 --- setup/pykd_setup_common.nsh | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/setup/pykd_setup_common.nsh b/setup/pykd_setup_common.nsh index ce7ba33..f915c30 100644 --- a/setup/pykd_setup_common.nsh +++ b/setup/pykd_setup_common.nsh @@ -27,7 +27,7 @@ SetCompressor LZMA !define PRODUCT_SHORT_NAME "pykd" !define PRODUCT_FULL_NAME "Python extension for WinDbg" -!define PRODUCT_VERSION "0.1.0.3" +!define PRODUCT_VERSION "0.1.0.13" !define PRODUCT_URL "http://pykd.codeplex.com/" !define PRODUCT_NAME_AND_VERSION "${PRODUCT_FULL_NAME} ${PRODUCT_ARCH} ${PRODUCT_VERSION}" !define PRODUCT_MANUFACTURER "PyKd Team" @@ -191,9 +191,9 @@ Section "${PRODUCT_SHORT_NAME} ${PRODUCT_ARCH}" sec_pykd SetOutPath "$INSTDIR" !if ${PRODUCT_ARCH} == "x64" - File "..\x64\Release\pykd.pyd" + File ".\binaries\x64\pykd.pyd" !else - File "..\Release\pykd.pyd" + File ".\binaries\x86\pykd.pyd" !endif SectionEnd @@ -202,8 +202,17 @@ Section "Snippets" sec_snippets SetOverwrite on DetailPrint "Extracting snippets..." - SetOutPath "$DOCUMENTS\${PRODUCT_SHORT_NAME}" - File "..\Snippets\*.py" + SetOutPath "$DOCUMENTS\${PRODUCT_SHORT_NAME}\Snippets" + File "..\branch\0.1.x\snippets\*.py" +SectionEnd + +Section "Samples" sec_samples + # Set Section properties + SetOverwrite on + + DetailPrint "Extracting samples..." + SetOutPath "$DOCUMENTS\${PRODUCT_SHORT_NAME}\Samples" + File /r "..\branch\0.1.x\samples\*.py" SectionEnd Section "Python ${PYTHON_VERSION} ${PRODUCT_ARCH}" sec_python @@ -233,9 +242,9 @@ Section "Visual C++ 2008 SP1 (${PRODUCT_ARCH}) runtime" sec_vcruntime SetOutPath "$TEMP" !if ${PRODUCT_ARCH} == "x64" - File "..\x64\Release\vcredist_${PRODUCT_ARCH}.exe" + File ".\binaries\x64\vcredist_${PRODUCT_ARCH}.exe" !else - File "..\Release\vcredist_${PRODUCT_ARCH}.exe" + File ".\binaries\x86\vcredist_${PRODUCT_ARCH}.exe" !endif ExecWait "$TEMP\vcredist_${PRODUCT_ARCH}.exe" @@ -278,7 +287,7 @@ Section -FinishSection WriteRegStr HKLM "Software\${PRODUCT_SHORT_NAME}" "InstallPath" "$INSTDIR" DetailPrint "Adding extension dir and snippets dir to PYTHONPATH..." - WriteRegStr HKLM "Software\Python\PythonCore\${PYTHON_VERSION}\PythonPath\${PRODUCT_SHORT_NAME}" "" "$INSTDIR;$DOCUMENTS\${PRODUCT_SHORT_NAME}" + WriteRegStr HKLM "Software\Python\PythonCore\${PYTHON_VERSION}\PythonPath\${PRODUCT_SHORT_NAME}" "" "$INSTDIR;$DOCUMENTS\${PRODUCT_SHORT_NAME}\Snippets;$DOCUMENTS\${PRODUCT_SHORT_NAME}\Samples" DetailPrint "Registering uninstaller..." WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_SHORT_NAME}" "DisplayName" "${PRODUCT_FULL_NAME} (${PRODUCT_ARCH})" @@ -342,7 +351,8 @@ FunctionEnd #------------------------------------------------------------------------------ LangString DESC_sec_pykd ${LANG_ENGLISH} "${PRODUCT_FULL_NAME}" -LangString DESC_sec_snippets ${LANG_ENGLISH} "Useful code snippets. Will be installed in $DOCUMENTS\${PRODUCT_SHORT_NAME}" +LangString DESC_sec_snippets ${LANG_ENGLISH} "Useful code snippets. Will be installed in $DOCUMENTS\${PRODUCT_SHORT_NAME}\Snippets" +LangString DESC_sec_samples ${LANG_ENGLISH} "Code samples. Will be installed in $DOCUMENTS\${PRODUCT_SHORT_NAME}\Samples" LangString DESC_sec_python ${LANG_ENGLISH} "Let installer download and setup Python ${PYTHON_VERSION} ${PRODUCT_ARCH}" LangString DESC_sec_vcruntime ${LANG_ENGLISH} "Let installer download and setup Microsoft Visual C++ 2008 SP1 (${PRODUCT_ARCH}) runtime library" LangString DESC_sec_msdia ${LANG_ENGLISH} "Let installer register Debug Interface Access (${PRODUCT_ARCH}) library" @@ -350,6 +360,7 @@ LangString DESC_sec_msdia ${LANG_ENGLISH} "Let installer register Debug Inte !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${sec_pykd} $(DESC_sec_pykd) !insertmacro MUI_DESCRIPTION_TEXT ${sec_snippets} $(DESC_sec_snippets) + !insertmacro MUI_DESCRIPTION_TEXT ${sec_samples} $(DESC_sec_samples) !insertmacro MUI_DESCRIPTION_TEXT ${sec_python} $(DESC_sec_python) !insertmacro MUI_DESCRIPTION_TEXT ${sec_vcruntime} $(DESC_sec_vcruntime) !insertmacro MUI_DESCRIPTION_TEXT ${sec_msdia} $(DESC_sec_msdia) @@ -435,7 +446,7 @@ Function un.onInit ${If} ${Errors} ${OrIf} $R0 == 0 - ${OrIfNot} ${IsPythonInstalled} + #${OrIfNot} ${IsPythonInstalled} !insertmacro UnselectSection ${unsec_python} SectionSetText ${unsec_python} "" ${EndIf} @@ -446,7 +457,7 @@ Function un.onInit ${If} ${Errors} ${OrIf} $R0 == 0 - ${OrIfNot} ${IsDiaRegistered} + #${OrIfNot} ${IsDiaRegistered} !insertmacro UnselectSection ${unsec_msdia} SectionSetText ${unsec_msdia} "" ${EndIf} @@ -457,7 +468,7 @@ Function un.onInit ${If} ${Errors} ${OrIf} $R0 == 0 - ${OrIfNot} ${IsVcRuntimeInstalled} + #${OrIfNot} ${IsVcRuntimeInstalled} !insertmacro UnselectSection ${unsec_vcruntime} SectionSetText ${unsec_vcruntime} "" ${EndIf}