<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Le Vosgien du Net &#187; Non classé</title>
	<atom:link href="http://levosgien.net/category/non-classe/feed/" rel="self" type="application/rss+xml" />
	<link>http://levosgien.net</link>
	<description>Parce que la vérité n'est pas toujours bonne à dire</description>
	<lastBuildDate>Thu, 11 Feb 2010 18:39:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Switch between versions of Firebird SQL Server</title>
		<link>http://levosgien.net/2009/12/01/switch-between-versions-of-firebird-sql-server/</link>
		<comments>http://levosgien.net/2009/12/01/switch-between-versions-of-firebird-sql-server/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 15:19:31 +0000</pubDate>
		<dc:creator>Pierre</dc:creator>
				<category><![CDATA[Geekitude]]></category>
		<category><![CDATA[Non classé]]></category>
		<category><![CDATA[firebird]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://levosgien.net/?p=172</guid>
		<description><![CDATA[	I wrote a little batch script to switch between versions of Firebird SQL Server nearly automatically.

The only one requirement is that all versions must be installed in C:\Program Files\Firebird\&#60;Version&#62; where  is Major.Minor version number of the Firebird Server you want to use.
	Eg : C:\Program Files\Firebird\1.5, C:\Program Files\Firebird\2.0, C:\Program Files\Firebird\2.1 ...
	Just copy the script in [...]]]></description>
			<content:encoded><![CDATA[	<p>I wrote a little batch script to switch between versions of <a href="http://www.firebirdsql.org">Firebird SQL Server</a> nearly automatically.<br />
<span id="more-172"></span><br />
The only one requirement is that all versions must be installed in <code>C:\Program Files\Firebird\&lt;Version&gt;</code> where <Version> is <code>Major.Minor</code> version number of the Firebird Server you want to use.</p>
	<p>Eg : <code>C:\Program Files\Firebird\1.5</code>, <code>C:\Program Files\Firebird\2.0</code>, <code>C:\Program Files\Firebird\2.1</code> ...</p>
	<p>Just copy the script in C:\Program Files\Firebird and start switching between versions of Firebird :</p>
	<p>C:\Program Files\Firebird\> switch 1.5<br />
C:\Program Files\Firebird\> switch 2.0<br />
...</p>
	<p>The code :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">echo</span> off
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #ff0000;">&quot;%OLD_PATH%&quot;</span> == <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>
  <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">OLD_PATH</span>=<span style="color: #000000; font-weight: bold;">%</span>PATH<span style="color: #000000; font-weight: bold;">%</span>
<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
setlocal
&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">FB_KEY</span>=HKLM\SOFTWARE\Firebird Project\Firebird Server\Instances
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">FB_VALUE</span>=DefaultInstance
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000; font-weight: bold;">/</span>F <span style="color: #ff0000;">&quot;skip=2 tokens=2*&quot;</span> <span style="color: #000000; font-weight: bold;">%%</span>A IN <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'reg query &quot;%FB_KEY%&quot; /v %FB_VALUE%'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>
  <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000; font-weight: bold;">/</span>F <span style="color: #ff0000;">&quot;delims=\ tokens=4&quot;</span> <span style="color: #000000; font-weight: bold;">%%</span>Y IN <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'echo %%B'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>
    <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">CURRENT_FB</span>=<span style="color: #000000; font-weight: bold;">%%</span>Y
  <span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">VERSION</span>=<span style="color: #000000; font-weight: bold;">%</span>1
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #ff0000;">&quot;%VERSION%&quot;</span> == <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> Syntax : <span style="color: #000000; font-weight: bold;">%</span>0 <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1.5</span> ^<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2.0</span> ^<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2.1</span> ^<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2.5</span> ^<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">3.0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Params <span style="color: #000000; font-weight: bold;">for</span> instsvc i^<span style="color: #7a0874; font-weight: bold;">&#40;</span>nstall^<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
  <span style="color: #000000; font-weight: bold;">if</span> not <span style="color: #000000; font-weight: bold;">%</span>CURRENT_FB<span style="color: #000000; font-weight: bold;">%</span> == <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>
    <span style="color: #000000; font-weight: bold;">if</span> exist <span style="color: #000000; font-weight: bold;">%</span>CURRENT_FB<span style="color: #000000; font-weight: bold;">%</span>\bin\instsvc.exe <span style="color: #7a0874; font-weight: bold;">&#40;</span>
      echo.
      <span style="color: #7a0874; font-weight: bold;">echo</span> Tip : These are the available options <span style="color: #000000; font-weight: bold;">for</span> instsvc from Firebird <span style="color: #000000; font-weight: bold;">%</span>CURRENT_FB<span style="color: #000000; font-weight: bold;">%</span>
      <span style="color: #000000; font-weight: bold;">%</span>CURRENT_FB<span style="color: #000000; font-weight: bold;">%</span>\bin\instsvc.exe
    <span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>
  <span style="color: #000000; font-weight: bold;">if</span> not <span style="color: #ff0000;">&quot;%CURRENT_FB%&quot;</span> == <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> Unregistering Firebird <span style="color: #000000; font-weight: bold;">%</span>CURRENT_FB<span style="color: #000000; font-weight: bold;">%</span>
&nbsp;
    <span style="color: #7a0874; font-weight: bold;">pushd</span> <span style="color: #000000; font-weight: bold;">%</span>CURRENT_FB<span style="color: #000000; font-weight: bold;">%</span>\bin
    instclient r g
    instsvc stop
    instsvc r
    instreg r
    <span style="color: #7a0874; font-weight: bold;">popd</span>  
&nbsp;
    echo.
  <span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">echo</span> Registering Firebird <span style="color: #000000; font-weight: bold;">%</span>VERSION<span style="color: #000000; font-weight: bold;">%</span>
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">pushd</span> <span style="color: #000000; font-weight: bold;">%</span>VERSION<span style="color: #000000; font-weight: bold;">%</span>\bin  
  instreg i <span style="color: #660033;">-z</span>
  instsvc i <span style="color: #000000; font-weight: bold;">%</span>2 <span style="color: #000000; font-weight: bold;">%</span>3 <span style="color: #000000; font-weight: bold;">%</span>4 <span style="color: #000000; font-weight: bold;">%</span>5 <span style="color: #000000; font-weight: bold;">%</span>6 <span style="color: #000000; font-weight: bold;">%</span>7 <span style="color: #000000; font-weight: bold;">%</span>8 <span style="color: #000000; font-weight: bold;">%</span>9
  instsvc start
  instclient i g
  <span style="color: #7a0874; font-weight: bold;">popd</span>
&nbsp;
  echo.
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">echo</span> Defining System Path to search <span style="color: #000000; font-weight: bold;">in</span> Firebird <span style="color: #000000; font-weight: bold;">%</span>VERSION<span style="color: #000000; font-weight: bold;">%</span> tools and some useful environment variables
&nbsp;
  endlocal 
  <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">%</span>OLD_PATH<span style="color: #000000; font-weight: bold;">%</span>;<span style="color: #ff0000;">&quot;%CD%\%VERSION%\bin&quot;</span>
  <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">ISC_USER</span>=SYSDBA
  <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">ISC_PASSWORD</span>=masterkey
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">echo</span> All Right <span style="color: #000000; font-weight: bold;">!</span>
<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

	<p>Hope this helps <img src='http://levosgien.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>


 ]]></content:encoded>
			<wfw:commentRss>http://levosgien.net/2009/12/01/switch-between-versions-of-firebird-sql-server/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
