<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Не срабатывает AHK UpDater]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=12106</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=12106&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Не срабатывает AHK UpDater».]]></description>
		<lastBuildDate>Tue, 22 Nov 2016 17:26:45 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Не срабатывает AHK UpDater]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=109281#p109281</link>
			<description><![CDATA[<p>Спасибо за правки - <strong><a href="http://forum.script-coding.com/profile.php?id=3850">Wisgest</a></strong> и <strong><a href="http://forum.script-coding.com/profile.php?id=26930">Malcev</a></strong>, всё работает.</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;Скрипт AutoHotkey Updater version = 0.013 (ИСПРАВЛЕНЫЙ и РАБОЧИЙ)</div><div class="fancy_spoiler"><div class="codebox"><pre><code>/*
[AutoHotkey Updater]
version = 0.013
*/

SelfUpdate = 1 ; Set to 0 to prevent the script from checking for updates to itself.

URL_Base    = https://autohotkey.com/download
URL_Script  = %URL_Base%/Update.ahk
URL_Setup   = %URL_Base%/ahk-install.exe
URL_Version = %URL_Base%/1.1/version.txt


#NoEnv
#Include *i %A_ScriptDir%\UpdateDebug.ahk

if 0 &gt; 0
{
    if IsFunc(&quot;_&quot; %True%) ; Recursive call, used to swap exes or elevate the process.
    {
        prms := Object()
        Loop %0%
            prms.Insert(%A_Index%)
        func := prms.Remove(1), _%func%(prms*)
        ExitApp
    }
    else if 1 = SuppressUpToDate ; Suppress &quot;AutoHotkey is up to date&quot; message.
        SuppressUpToDate := true
}

if !A_IsCompiled &amp;&amp; SelfUpdate
{
    ; First, check for a newer version of this script.
    URLDownloadToFile %URL_Script%, %A_Temp%\Update.ahk
    IniRead rver, %A_Temp%\Update.ahk, AutoHotkey Updater, version, %A_Space%
    IniRead lver, %A_ScriptFullPath%,  AutoHotkey Updater, version, %A_Space%
    if (lver &lt; rver)
    {
        MsgBox 3, AutoHotkey Updater,
        (LTrim Join`s
        A newer version of this script is available.  It is recommended
        that you use the updated version of the script to install further
        updates.  *** WARNING: If you click yes, any modifications you
        have made to this script will be lost. ***
        `n`nUse the updated script?
        )
        ifMsgBox Yes
        {
            _SelfUpdate(A_Temp &quot;\Update.ahk&quot;)
            ExitApp
        }
        ifMsgBox Cancel
        {
            FileDelete %A_Temp%\Update.ahk
            ExitApp
        }
    }
    FileDelete %A_Temp%\Update.ahk
}


; Retrieve latest version number.
try
{
    whr := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
    whr.Open(&quot;GET&quot;, URL_Version, false), whr.Send()
    version := whr.ResponseText
    if !(version ~= &quot;^\d+\.\d&quot;)
        throw ; 404?
}
catch
{
    MsgBox 48, AutoHotkey Updater, There was a problem checking for updates.  Please check your internet connection or try again later.
    ExitApp
}


if (version &lt;= A_AhkVersion)
    &amp;&amp; !RegExMatch(A_AhkVersion, &quot;^\Q&quot; version &quot;\E-&quot;)  ; Quick hack for beta -&gt; final version.
{
    if !SuppressUpToDate
        MsgBox 64, AutoHotkey Updater,
        (Ltrim
        AutoHotkey is up to date.
        
        Installed version:`t%A_AhkVersion%
        Latest version:`t%version%
        )
    ExitApp
}

MsgBox 68, AutoHotkey Update Available,
(
An update for AutoHotkey is available.

Installed version:`t%A_AhkVersion%
Latest version:`t%version%

Would you like to install it now?
)
ifMsgBox No
    ExitApp

TempFile := A_Temp &quot;\ahk-install.exe&quot;

; Download the new package
if !Download(URL_Setup, TempFile)
{
    MsgBox 16, AutoHotkey Updater, Update failed due to a download error.
    ExitApp
}

; Run setup
try Run &quot;%TempFile%&quot; /exec kill %A_ScriptHwnd% /exec Downloaded &quot;%TempFile%&quot;
ExitApp


_SelfUpdate(source_path)
{
    ; Copy and Delete instead of Move so that file permissions are inherited correctly.
    FileCopy %source_path%, %A_ScriptFullPath%, 1
    if ErrorLevel
    {
        if !A_IsAdmin
        {   ; Try again as admin.
            if Elevate(&quot;SelfUpdate&quot;, source_path)
                ExitApp
        }
        MsgBox 16, AutoHotkey Updater, Script update failed.  Error %err%.
        ExitApp
    }
    FileDelete %source_path%
    Reload
}


Elevate(func, prms*)
{
    cmd := func
    for i,prm in prms
    {
        StringReplace prm, prm, `&quot;, &quot;&quot;, All
        cmd .= &quot; &quot;&quot;&quot; prm &quot;&quot;&quot;&quot;
    }
    if A_IsCompiled
        exe := A_ScriptFullPath
    else
        exe := A_AhkPath, cmd := &quot;&quot;&quot;&quot; A_ScriptFullPath &quot;&quot;&quot; &quot; cmd
    return DllCall(&quot;shell32\ShellExecute&quot;, &quot;ptr&quot;, 0, &quot;str&quot;, &quot;RunAs&quot;
                    , &quot;str&quot;, exe, &quot;str&quot;, cmd, &quot;ptr&quot;, 0, &quot;int&quot;, 1) &gt; 32
}


; Based on code by Sean and SKAN @ http://www.autohotkey.com/forum/viewtopic.php?p=184468#184468
Download(url, file)
{
    static vt
    if !VarSetCapacity(vt)
    {
        VarSetCapacity(vt, A_PtrSize*11), nPar := &quot;31132253353&quot;
        Loop Parse, nPar
            NumPut(RegisterCallback(&quot;DL_Progress&quot;, &quot;F&quot;, A_LoopField, A_Index-1), vt, A_PtrSize*(A_Index-1))
    }
    global _cu
    SplitPath file, dFile
    SysGet m, MonitorWorkArea, 1
    scale := A_ScreenDPI ? A_ScreenDPI/96 : 1, y := mBottom-52*scale-2, x := mRight-330*scale-2
    , VarSetCapacity(_cu, 100), VarSetCapacity(tn, 520)
    , DllCall(&quot;shlwapi\PathCompactPathEx&quot;, &quot;str&quot;, _cu, &quot;str&quot;, url, &quot;uint&quot;, 50, &quot;uint&quot;, 0)
    Progress Hide CWFAFAF7 CT000020 CB445566 x%x% y%y% w330 h52 B1 FS8 WM700 WS700 FM8 ZH12 ZY3 C11,, %_cu%, AutoHotkeyProgress, Tahoma
    if (0 = DllCall(&quot;urlmon\URLDownloadToCacheFile&quot;, &quot;ptr&quot;, 0, &quot;str&quot;, url, &quot;str&quot;, tn, &quot;uint&quot;, 260, &quot;uint&quot;, 0x10, &quot;ptr*&quot;, &amp;vt))
        FileCopy %tn%, %file%, 1
    else
        ErrorLevel := 1
    Progress Off
    return !ErrorLevel
}
DL_Progress( pthis, nP=0, nPMax=0, nSC=0, pST=0 )
{
    global _cu
    if A_EventInfo = 6
    {
        Progress Show
        Progress % P := 100*nP//nPMax, % &quot;Downloading:     &quot; Round(np/1024,1) &quot; KB / &quot; Round(npmax/1024) &quot; KB    [ &quot; P &quot;`% ]&quot;, %_cu%
    }
    return 0
}</code></pre></div></div></div>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Tue, 22 Nov 2016 17:26:45 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=109281#p109281</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не срабатывает AHK UpDater]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=109270#p109270</link>
			<description><![CDATA[<p>У меня с изменениями, предложенными <strong>wisgest</strong> в 4 посте, всё работает.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 22 Nov 2016 03:45:10 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=109270#p109270</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не срабатывает AHK UpDater]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=109258#p109258</link>
			<description><![CDATA[<p><strong>Malcev</strong>, Приветствую.</p><p>У меня...<br /><span style="color: #3366ff"><strong>OS: MS Windows 7 Ultimate Ru SP1 x64</strong></span></p><p><span style="color: #663300"><strong>Как выглядит проверка обновлений и установка если они есть?</strong></span></p><p>«Предупреждение системы безопасности» - я отключил. </p><div class="codebox"><pre><code>REGEDIT4
 
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments]
&quot;SaveZoneInformation&quot;=dword:00000001
 
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
&quot;LowRiskFileTypes&quot;=&quot;.exe;.bat;.reg;.msi;.htm;.html;.ico;.gif;.bmp;.jpg;.mkv;.mp4;.avi;.mpg;.mpeg;.mov;.mp3;.m3u;.wav;&quot;  </code></pre></div><p>P.S. Можно было использовать <strong>Групповые Политики</strong>, что менее безопасно и более радикально, но у меня защита реализована на уровне AVP.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Mon, 21 Nov 2016 12:40:04 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=109258#p109258</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не срабатывает AHK UpDater]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=109115#p109115</link>
			<description><![CDATA[<p>Значит, наверное, проблема у WinXP с данным сайтом.<br />У меня как-то с одним сайтом не работал WinHTTPRequest на Win7, а Msxml2.XMLHTTP работал.<br />А на Win10 работали оба.<br /><a href="http://forum.script-coding.com/viewtopic.php?id=11238%20">http://forum.script-coding.com/viewtopic.php?id=11238 </a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sun, 13 Nov 2016 11:52:36 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=109115#p109115</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не срабатывает AHK UpDater]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=109114#p109114</link>
			<description><![CDATA[<p><strong>Malcev</strong>, изначально речь шла всё-таки о <a href="https://autohotkey.com">https://autohotkey.com</a>.</p><p>Сценарий с <em>Msxml2.XMLHTTP</em> работает с требованием подтверждения действия в диалоговом окне «Предупреждение системы безопасности»,<br />с <em>WinHTTP.WinHTTPRequest.5.1</em>— работает, если<br /></p><div class="codebox"><pre><code>http.Option(4) := 0x3300</code></pre></div><p>Но если<br /></p><div class="codebox"><pre><code>link := &quot;https://autohotkey.com&quot;</code></pre></div><p>ни один изначально не работает, и оба работают без предупреждений (вероятно, последние сутки) после предложенной мною правки файла hosts.</p>]]></description>
			<author><![CDATA[null@example.com (wisgest)]]></author>
			<pubDate>Sun, 13 Nov 2016 11:44:10 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=109114#p109114</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не срабатывает AHK UpDater]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=109113#p109113</link>
			<description><![CDATA[<p><strong>wisgest</strong>, а что именно у вас не работает?<br />У меня ахк загружается так (Win-7):<br /></p><div class="codebox"><pre><code>link := &quot;https://ahkscript.org&quot;
http := ComObjCreate(&quot;Msxml2.XMLHTTP&quot;)
http.Open(&quot;GET&quot;, link, False)
http.Send()
msgbox % http.responseText</code></pre></div><p>Либо так:<br /></p><div class="codebox"><pre><code>link := &quot;https://ahkscript.org&quot;
http := ComObjCreate(&quot;WinHTTP.WinHTTPRequest.5.1&quot;)
http.Option(4) := 0x3300
http.Open(&quot;GET&quot;, link, False)
http.Send()
msgbox % http.responseText</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sun, 13 Nov 2016 11:08:43 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=109113#p109113</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не срабатывает AHK UpDater]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=109109#p109109</link>
			<description><![CDATA[<p>Однако сертификат используемый ahkscript.org (но выданный autohotkey.com) истекает<br />2016-11-13 23:10:00 GMT.</p><br /><p><span class="bbu"><em>Добавлено позже:</em></span> Сертификат продлён:<br /></p><div class="quotebox"><cite>Opera Internet Browser пишет:</cite><blockquote><div class="codebox"><pre><code>Недействителен до...	2016-11-14 02:58:00 GMT
Недействителен после...	2017-02-12 02:58:00 GMT
</code></pre></div></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (wisgest)]]></author>
			<pubDate>Sun, 13 Nov 2016 09:15:30 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=109109#p109109</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не срабатывает AHK UpDater]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=109107#p109107</link>
			<description><![CDATA[<p>Но если в нём и нет других ошибок, то даже с учётом указанных исправлений скрипт у меня работать не будет — см. «<a href="http://forum.script-coding.com/viewtopic.php?pid=109105#p109105">Re: VBS/ANY: CDO.Message не может отправить почту,&quot;не далось подключиться&quot;</a>». В то же время <a href="https://ahkscript.org">https://ahkscript.org</a> у меня открывается, но с предупреждением, что сертификат выдан другому сайту.<br /></p><div class="quotebox"><cite>autohotkey.com пишет:</cite><blockquote><p>Error:&nbsp; 0x80072F8F - <br />Source:		WinHttp.WinHttpRequest<br />Description:	A security error occurred</p></blockquote></div><div class="quotebox"><cite>ahkscript.org пишет:</cite><blockquote><p>Error:&nbsp; 0x80072F06 - <br />Source:		WinHttp.WinHttpRequest<br />Description:	The host name in the certificate is invalid or does not match</p></blockquote></div><p>Насколько я могу судить, это полные зеркала, за исключением того, что на ahkscript.org есть <a href="http://ahkscript.org/foundation">кое-что, чего нет на autohotkey.com</a>.</p><p>Но т.к. ссылки и адреса изображений на форуме являются абсолютными, то использовать ahkscript.org не удобно.</p><p>Прописал в файле hosts для autohotkey.com IP от ahkskript.org:<br /></p><div class="codebox"><pre><code>45.55.88.45	autohotkey.com
#104.24.122.247	autohotkey.com
#45.55.88.45	ahkscript.org
</code></pre></div><p>— пока работает. Забавно, что при этом <a href="http://autohotkey.com/foundation">http://autohotkey.com/foundation</a> всё-равно перенаправляет на ahkscript.org, т.е. это действительно полные зеркала, но на сервере проверяется заголовок HTTP-запроса <em>Host</em>.</p>]]></description>
			<author><![CDATA[null@example.com (wisgest)]]></author>
			<pubDate>Sun, 13 Nov 2016 08:24:38 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=109107#p109107</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не срабатывает AHK UpDater]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=109078#p109078</link>
			<description><![CDATA[<div class="quotebox"><cite>Indomito пишет:</cite><blockquote><p>Я пользуюсь скриптом Update.ahk и пользуюсь весьма давно. Нашёл его где - то на форуме.</p><p>Вот первые его строчки…</p></blockquote></div><p>Скрипт лежит на <a href="https://autohotkey.com/download/Update.ahk">прежнем месте</a> и имеет прежнюю версию.</p><p>Похоже, что в нём по меньшей мере две программные ошибки — строки:<br /></p><div class="codebox"><pre><code>URL_Version = %UpdateURL%/1.1/version.txt</code></pre></div><div class="codebox"><pre><code>    whr.Open(&quot;GET&quot;, VersionURL, false), whr.Send()</code></pre></div><p>более правдоподобно смотрелись бы в виде:<br /></p><div class="codebox"><pre><code>URL_Version = %URL_Base%/1.1/version.txt</code></pre></div><div class="codebox"><pre><code>    whr.Open(&quot;GET&quot;, URL_Version, false), whr.Send()</code></pre></div><div class="quotebox"><cite>Indomito пишет:</cite><blockquote><p>Да, новая версия лежит на офф. форуме, правда вызывает туже ошибку.<br />Я скачал в ZIP-формате и установил поверх старой.</p></blockquote></div><p>Где?</p>]]></description>
			<author><![CDATA[null@example.com (wisgest)]]></author>
			<pubDate>Fri, 11 Nov 2016 13:11:55 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=109078#p109078</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не срабатывает AHK UpDater]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=108655#p108655</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Да, новая версия лежит на офф. форуме, правда вызывает туже ошибку.<br />Я скачал в ZIP-формате и установил поверх старой.</p><p><strong>Попробую найти рабочую версию и дать на неё линк.</strong></p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Fri, 28 Oct 2016 09:15:10 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=108655#p108655</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не срабатывает AHK UpDater]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=108654#p108654</link>
			<description><![CDATA[<p>У меня сейчас так же, но вопрос не по адресу, пишите на офф. форум. Я пользуюсь инсталлером для обновлений.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 28 Oct 2016 09:04:02 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=108654#p108654</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Не срабатывает AHK UpDater]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=108651#p108651</link>
			<description><![CDATA[<p>Приветствую.</p><p>Я пользуюсь скриптом <strong>Update.ahk </strong>и пользуюсь весьма давно. Нашёл его где - то на форуме.</p><p>Вот первые его строчки. </p><div class="codebox"><pre><code>/*
[AutoHotkey Updater]
version = 0.013
*/

SelfUpdate = 1 ; Set to 0 to prevent the script from checking for updates to itself.

URL_Base    = https://autohotkey.com/download
URL_Script  = %URL_Base%/Update.ahk
URL_Setup   = %URL_Base%/ahk-install.exe
URL_Version = %UpdateURL%/1.1/version.txt


#NoEnv
#Include *i %A_ScriptDir%\UpdateDebug.ahk</code></pre></div><p>В чём проблема то?</p><p>P.S. Проблем с интернетом нет.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Fri, 28 Oct 2016 08:46:58 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=108651#p108651</guid>
		</item>
	</channel>
</rss>
