<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408489&amp;view=findpost&amp;p=3662253</guid>
        <pubDate>Tue, 29 Mar 2016 14:09:21 +0000</pubDate>
        <title>RegDBGetKeyValueEx падает с ошибкой, при попытке получить значение из реестра.</title>
        <link>https://forum.sources.ru/index.php?showtopic=408489&amp;view=findpost&amp;p=3662253</link>
        <description><![CDATA[KILLER: Разобрался.]]></description>
        <author>KILLER</author>
        <category>Инсталляторы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408489&amp;view=findpost&amp;p=3662241</guid>
        <pubDate>Tue, 29 Mar 2016 12:43:45 +0000</pubDate>
        <title>RegDBGetKeyValueEx падает с ошибкой, при попытке получить значение из реестра.</title>
        <link>https://forum.sources.ru/index.php?showtopic=408489&amp;view=findpost&amp;p=3662241</link>
        <description><![CDATA[KILLER: В общем вроде разобрался. Проблема была в том, что нужно было поставить следующую опцию, перед чтением реестра:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">...</div><div class="code_line">REGDB_OPTIONS = REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY;</div><div class="code_line">&nbsp;</div><div class="code_line">if (RegDBKeyExist(szKey) == 1) &nbsp;then</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; if (RegDBGetKeyValueEx(szKey, szName, nvType, szSharePointProperty, nvSize) == 0) &nbsp;then</div><div class="code_line">...</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
Но теперь возникла другая проблема, почему то записывается путь Program Files, а IS показывает Program File(x86)  :-?  :wall:]]></description>
        <author>KILLER</author>
        <category>Инсталляторы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408489&amp;view=findpost&amp;p=3662217</guid>
        <pubDate>Tue, 29 Mar 2016 10:30:05 +0000</pubDate>
        <title>RegDBGetKeyValueEx падает с ошибкой, при попытке получить значение из реестра.</title>
        <link>https://forum.sources.ru/index.php?showtopic=408489&amp;view=findpost&amp;p=3662217</link>
        <description><![CDATA[KILLER: Всем привет.<br>
<br>
Столкнулся с проблемой. Мне нужно запилить в инсталятор с помощью InstallShield 12, такую фичу:<br>
Есть SharePoint разных версий. В зависимости от версии он ставится по определенному пути. В общем сделал я у себя CustomAction, и наваял скрипт, который должен узнавать по какому пути расположен SharePoint, и записывать его местоположение в определенную проперти:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">function DetectSharePointDir(hMSI) &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp;// To Do: &nbsp;Declare local variables.</div><div class="code_line">begin &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp;SetSharePointInfoToProperty(hMSI, &quot;SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0&quot;, &quot;Version&quot;, &quot;SHAREPOINT_VERSION&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;SetSharePointInfoToProperty(hMSI, &quot;SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0&quot;, &quot;SharePoint&quot;, &quot;SHAREPOINT_INSTALLED&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;SetSharePointInfoToProperty(hMSI, &quot;SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0&quot;, &quot;Location&quot;, &quot;SHAREPOINTDIR&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;SetSharePointInfoToProperty(hMSI, &quot;SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0&quot;, &quot;Version&quot;, &quot;SHAREPOINT_VERSION&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;SetSharePointInfoToProperty(hMSI, &quot;SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0&quot;, &quot;SharePoint&quot;, &quot;SHAREPOINT_INSTALLED&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;SetSharePointInfoToProperty(hMSI, &quot;SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0&quot;, &quot;Location&quot;, &quot;SHAREPOINTDIR&quot;);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;SetSharePointInfoToProperty(hMSI, &quot;SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0&quot;, &quot;Version&quot;, &quot;SHAREPOINT_VERSION&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;SetSharePointInfoToProperty(hMSI, &quot;SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0&quot;, &quot;SharePoint&quot;, &quot;SHAREPOINT_INSTALLED&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;SetSharePointInfoToProperty(hMSI, &quot;SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0&quot;, &quot;Location&quot;, &quot;SHAREPOINTDIR&quot;);</div><div class="code_line">&nbsp;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">function SetSharePointInfoToProperty(hMSI, szKey, szName, szProperty)</div><div class="code_line">&nbsp;&nbsp; &nbsp;NUMBER nvType, nvSize, nResult;</div><div class="code_line">&nbsp;&nbsp; &nbsp;STRING szSharePointProperty; &nbsp; &nbsp;</div><div class="code_line">begin &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp;RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp;nResult = RegDBGetKeyValueEx(&quot;SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0&quot;, &quot;Location&quot;, nvType, szSharePointProperty, nvSize ); //! Вот это просто для теста</div><div class="code_line">&nbsp;&nbsp; &nbsp;MessageBox(FormatMessage(nResult), SEVERE);</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (RegDBKeyExist(szKey) == 1) &nbsp;then</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; if (RegDBGetKeyValueEx(szKey, szName, nvType, szSharePointProperty, nvSize) == 0) &nbsp;then</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MsiSetProperty(hMSI, szProperty, szSharePointProperty); &nbsp; &nbsp; &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; endif;</div><div class="code_line">&nbsp;&nbsp; &nbsp;endif;</div><div class="code_line">end;</div></ol></div></div></div></div><br>
Так вот возникла проблема с функцией RegDBGetKeyValueEx - она мне возвращает ошибку аля &quot;Файл не найден&quot;, т.е. как я понимаю она не может вычитать из реестра значение нужной мне опции в реестре. Хотя RegDBKeyExist - выполняется без проблем. Все эти значения в реестре существуют.<br>
Что я делаю не так? <br>
<br>
Спасибо. <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2016-03-29T10:36:18+00:00">29.03.16, 10:36</time></span></span><br>
Хотя вот сейчас попробовал из примера:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">nResult = RegDBGetKeyValueEx(&quot;Software\Microsoft\Windows NT\CurrentVersion&quot;,&quot;RegisteredOwner&quot;,nvType,svRegisteredOwner,nvSize);</div></ol></div></div></div></div><br>
Работает. Почему она тогда не хочет мое значение считывать? В чем косяк то? :huh: <br>
В реестре реально по вышеозвученным путям все есть.]]></description>
        <author>KILLER</author>
        <category>Инсталляторы</category>
      </item>
	
      </channel>
      </rss>
	