<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; CMD/BAT: Запись в файл имени файла по маске]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8089&amp;type=atom" />
	<updated>2013-02-18T10:12:13Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8089</id>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Запись в файл имени файла по маске]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69616#p69616" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>http://byffox.sourceforge.net/forum/top … mp;topic=6 инструкция на русском</p></blockquote></div><div class="quotebox"><blockquote><p>.\firefox-update\updater.exe .\firefox-update 0</p></blockquote></div><p>Устарела<br /></p><div class="quotebox"><blockquote><p>For Firefox 4.0.x and above, SeaMonkey 2.1.x and above, or Thunderbird 5.0.x and above run the following from the command prompt</p><p>&nbsp; &nbsp; &lt;path to outside directory&gt;\updater.exe &lt;path to <strong>outside directory</strong>&gt; &lt;path to<strong> installation directory</strong>&gt;</p></blockquote></div><p>И как бы инструкция с неясного форума и Wiki Mozilla - разные вещи.<br />Хотя как подсказывает опыт <strong>vlc</strong>... официальный источник тоже непанацея.</p>]]></content>
			<author>
				<name><![CDATA[UNDYING]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27822</uri>
			</author>
			<updated>2013-02-18T10:12:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69616#p69616</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Запись в файл имени файла по маске]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69615#p69615" />
			<content type="html"><![CDATA[<p><a href="http://byffox.sourceforge.net/forum/topic.php?forum=8&amp;topic=6">http://byffox.sourceforge.net/forum/top … mp;topic=6</a> инструкция на русском</p>]]></content>
			<author>
				<name><![CDATA[alfatedg]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29657</uri>
			</author>
			<updated>2013-02-18T10:02:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69615#p69615</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Запись в файл имени файла по маске]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69614#p69614" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>и использует эту инструкцию</p></blockquote></div><p><a href="https://wiki.mozilla.org/Software_Update:Manually_Installing_a_MAR_file">Инструкция</a>:<br /></p><div class="quotebox"><blockquote><p>Steps for Windows</p><p>&nbsp; &nbsp; Create a directory outside of the application&#039;s installation directory to be updated (e.g. C:\app-update\). This directory will be referred to as the outside directory throughout the instructions below so please make a note of its location. Grant the user account you are using Full Control permissions on this directory if it doesn&#039;t have these permission already.<br />&nbsp; &nbsp; Copy updater.exe from the application&#039;s installation directory that is to be upgraded into the outside directory. If you would like to display the updater user interface while it is applying the update also copy the updater.ini into the outside directory.<br />&nbsp; &nbsp; Download the appropriate .mar file and put it into the outside directory you created (see Where to get a mar file).<br />&nbsp; &nbsp; Rename the mar file you downloaded to update.mar.<br />&nbsp; &nbsp; Open a command prompt by running cmd.exe. On Windows Vista or greater you may need to launch cmd.exe with &quot;Run as administrator&quot; (available in the context menu when right clicking cmd.exe).<br />&nbsp; &nbsp; Change the working directory to the application&#039;s installation directory by using the cd command (e.g. for Firefox cd &quot;C:\Program Files\Mozilla Firefox&quot;). Important: running the update from within another directory will fail to update the existing installation properly with Firefox 3.6.x and below, SeaMonkey 2.0.x and below, and Thunderbird 3.1.x and below.<br />&nbsp; &nbsp; Close all instances of the application that are running on the system including those being used by other users before going any further. Important: not doing so will cause the update to fail.<br />&nbsp; &nbsp; For Firefox 4.0.x and above, SeaMonkey 2.1.x and above, or Thunderbird 5.0.x and above run the following from the command prompt</p><p>&nbsp; &nbsp; &lt;path to outside directory&gt;\updater.exe &lt;path to outside directory&gt; &lt;path to installation directory&gt;</p><br /><p>&nbsp; &nbsp; For Firefox 3.5.x and 3.6.x, SeaMonkey 2.0.x, or Thunderbird 3.0.x and 3.1.x run the following from the command prompt</p><p>&nbsp; &nbsp; &lt;path to outside directory&gt;\updater.exe &lt;path to outside directory&gt;\</p><br /><p>&nbsp; &nbsp; For Firefox 3.0.x or Thunderbird 2.0.x run the following from the command prompt</p><p>&nbsp; &nbsp; &lt;path to outside directory&gt;\updater.exe &lt;path to outside directory&gt;\ 0</p><p>&nbsp; &nbsp; Note: The &quot;0&quot; parameter passed on the command line specifies the PID of a process to wait on before applying the update. When applying updates manually this should be 0 to disable the wait step.<br />&nbsp; &nbsp; After the update has completed a file named update.status will be created in the outside directory. Open the update.status status file in an editor (e.g. notepad.exe). If the update is successful then the file will contain the text &quot;succeeded&quot;. If it does not contain the text &quot;succeeded&quot;, then the update.log file may be consulted to diagnose at what step the update failed. A failed update should leave the original application&#039;s installation intact. DO NOT continue to the next section unless the update succeeded.<br />&nbsp; &nbsp; Copy the update.log to the uninstall directory inside of the application&#039;s installation directory.<br />&nbsp; &nbsp; Rename it to uninstall.update.<br />&nbsp; &nbsp; Run the following from the command prompt</p><p>&nbsp; &nbsp; &lt;path to installation directory&gt;\uninstall\helper.exe /PostUpdate</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[UNDYING]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27822</uri>
			</author>
			<updated>2013-02-18T09:55:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69614#p69614</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Запись в файл имени файла по маске]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69613#p69613" />
			<content type="html"><![CDATA[<p>update.mar берется с ftp. это и есть обновление. в update.version пишется версия из имени файла. Другое дело, что эту команду можно было написать одной строчкой, но мне так проще</p>]]></content>
			<author>
				<name><![CDATA[alfatedg]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29657</uri>
			</author>
			<updated>2013-02-18T09:51:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69613#p69613</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Запись в файл имени файла по маске]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69612#p69612" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>alfatedg пишет:</cite><blockquote><p>UNDYING, собственно, батник и использует эту инструкцию. файлы обновления должны лежать в корне с батником. Обновление же происходит при запуске firefox на последнем этапе</p></blockquote></div><p>А зачем тогда:<br /></p><div class="quotebox"><blockquote><p>xcopy &quot;update.mar&quot; ^<br />&quot;%USERPROFILE%\AppData\Local\Mozilla\Firefox\Mozilla Firefox\updates\0\&quot; /Y<br />xcopy &quot;update.version&quot; ^<br />&quot;%USERPROFILE%\AppData\Local\Mozilla\Firefox\Mozilla Firefox\updates\0\&quot; /Y</p></blockquote></div><p>?</p>]]></content>
			<author>
				<name><![CDATA[UNDYING]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27822</uri>
			</author>
			<updated>2013-02-18T09:49:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69612#p69612</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Запись в файл имени файла по маске]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69611#p69611" />
			<content type="html"><![CDATA[<p>UNDYING, собственно, батник и использует эту инструкцию. файлы обновления должны лежать в корне с батником. Обновление же происходит при запуске firefox на последнем этапе</p><p>update.version у меня находится в папке pub\ а потом копируется в %USERPROFILE%\AppData\Local\Mozilla\Firefox\Mozilla Firefox\updates\0\</p><p>Скрипт писал для выволнения на сервере ночью. Запустил и забыл</p>]]></content>
			<author>
				<name><![CDATA[alfatedg]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29657</uri>
			</author>
			<updated>2013-02-18T09:44:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69611#p69611</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Запись в файл имени файла по маске]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69610#p69610" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>alfatedg пишет:</cite><blockquote><p>Для успешного обновления надо эту версию писать в файл version</p></blockquote></div><p>А где он должен находиться? И каков формат?<br />Судя по <a href="https://wiki.mozilla.org/Software_Update">докам</a> - там <strong>xml</strong> в utf-8, и как в него вы батником писать будете? Может проще по <a href="https://wiki.mozilla.org/Software_Update:Manually_Installing_a_MAR_file">инструкции</a>, благо там уже всё <a href="https://wiki.mozilla.org/Software_Update:Manually_Installing_a_MAR_file#Steps_for_Windows">написано</a>.<br /></p><div class="codebox"><pre><code>
@echo off
set wdir=%cd%
copy /y %Programfiles%\&quot;Mozilla Firefox&quot;\updater.* ./
wget bla-bla-bla ...
cd /d %Programfiles%\&quot;Mozilla Firefox&quot;
taskkill /F /IM firefox.exe
start /w %wdir%\updater.exe %wdir% %cd%
(type %wdir%\update.status | find /i &quot;succeeded&quot; 2&gt;&amp;1 &gt;nul) || (
         echo update aborted
         exit /b 1)
type %wdir%\update.log &gt; uninstall\uninstall.update
start /w uninstall\helper.exe /PostUpdate
rd /s/q %wdir%
exit /b 0
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[UNDYING]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27822</uri>
			</author>
			<updated>2013-02-18T09:40:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69610#p69610</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Запись в файл имени файла по маске]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69609#p69609" />
			<content type="html"><![CDATA[<p>Огромное спасибо, alexii. Это было то, что нужно!<br />конечный вариант выглядит так</p><div class="codebox"><pre><code>@Echo Off
setlocal enableextensions enabledelayedexpansion
xcopy &quot;update*&quot; ^
&quot;%USERPROFILE%\AppData\Local\Mozilla\Firefox\Mozilla Firefox\updates\0\&quot; /Y
md %CD%\pub\
cd pub\
del *.* /q
&quot;C:\Program Files\GnuWin32\bin\wget&quot; -nH ftp://anonymous:anonymous@ftp.mozilla.org^
/pub/mozilla.org/firefox/releases/latest/update/win32/ru/*complete.mar
for /f &quot;usebackq delims=&quot; %%i in (`dir /b &quot;firefox-*.*.*.complete.mar&quot;`) do (
    set sName=%%~ni
    set sVersion=!sName:firefox-=!
    &gt;&quot;update.version&quot; echo !sVersion:.complete=!
)
ren *.complete.mar* update.mar
xcopy &quot;update.mar&quot; ^
&quot;%USERPROFILE%\AppData\Local\Mozilla\Firefox\Mozilla Firefox\updates\0\&quot; /Y
xcopy &quot;update.version&quot; ^
&quot;%USERPROFILE%\AppData\Local\Mozilla\Firefox\Mozilla Firefox\updates\0\&quot; /Y
cd ..
taskkill /F /IM firefox.exe
start /d&quot;C:\Program Files (x86)\Mozilla Firefox&quot; firefox.exe
rd pub /q /s</code></pre></div>]]></content>
			<author>
				<name><![CDATA[alfatedg]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29657</uri>
			</author>
			<updated>2013-02-18T09:30:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69609#p69609</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Запись в файл имени файла по маске]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69602#p69602" />
			<content type="html"><![CDATA[<p><span style="color: green">А я сказал, префиксу (CMD/BAT: ) — быть! <img src="//forum.script-coding.com/img/smilies/lol.png" width="15" height="15" /></span></p><p>Используйте разбор:<br /></p><div class="codebox"><pre><code>@echo off
setlocal enableextensions enabledelayedexpansion

for /f &quot;usebackq delims=&quot; %%i in (`dir /b &quot;firefox-*.*.*.complete.mar&quot;`) do (
    set sName=%%~ni
    set sVersion=!sName:firefox-=!
    &gt;&quot;version&quot; echo !sVersion:.complete=!
)

endlocal
exit /b 0
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2013-02-18T07:54:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69602#p69602</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Запись в файл имени файла по маске]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69598#p69598" />
			<content type="html"><![CDATA[<p>файл лежит по адресу ftp://anonymous:anonymous@ftp.mozilla.org^<br />/pub/mozilla.org/firefox/releases/latest/update/win32/ru/*complete.mar<br />содержит полное обновление для firefox. Для успешного обновления надо эту версию писать в файл version<br />причем, есть предположение, что они-разрабы лисы, могут применить в версии и буквы</p>]]></content>
			<author>
				<name><![CDATA[alfatedg]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29657</uri>
			</author>
			<updated>2013-02-18T06:03:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69598#p69598</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Запись в файл имени файла по маске]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69597#p69597" />
			<content type="html"><![CDATA[<p>Поясните подробнее. На реальных примерах. Что известно об имени файла и его местоположении?</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2013-02-18T06:02:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69597#p69597</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[CMD/BAT: Запись в файл имени файла по маске]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69596#p69596" />
			<content type="html"><![CDATA[<p>Здравствуйте. Нужен батник, который будет записывать в файл version версию файла, который называется blablabla-1.2.3.blablabla.dat<br />то есть в version должен быть только кусок 1.2.3 -все цифры, не теряя точки. Привязываться к порядковому номеру цифр нельзя.</p><p>Сам скрипт пишется для обновления firefox на сервере компании с большим количеством терминальных пользователей. <br /></p><div class="codebox"><pre><code>@Echo Off
md %CD%\pub\
xcopy &quot;update*&quot; ^
&quot;%USERPROFILE%\AppData\Local\Mozilla\Firefox\Mozilla Firefox\updates\0\&quot; /Y
cd pub\
del *.* /q
&quot;C:\Program Files\GnuWin32\bin\wget&quot; -nH ftp://anonymous:anonymous@ftp.mozilla.org^
/pub/mozilla.org/firefox/releases/latest/update/win32/ru/*complete.mar
ren *.complete.mar* update.mar
xcopy &quot;update.mar&quot; ^
&quot;%USERPROFILE%\AppData\Local\Mozilla\Firefox\Mozilla Firefox\updates\0\&quot; /Y
cd ..
@Echo off
taskkill /F /IM firefox.exe
start /d&quot;C:\Program Files (x86)\Mozilla Firefox&quot; firefox.exe
rd pub /q /s</code></pre></div>]]></content>
			<author>
				<name><![CDATA[alfatedg]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29657</uri>
			</author>
			<updated>2013-02-18T05:55:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69596#p69596</id>
		</entry>
</feed>
