<?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>Saved for later reference &#187; win32</title>
	<atom:link href="http://www.lejordet.com/tag/win32/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lejordet.com</link>
	<description>online repository of stuff I had to google for hours to figure out</description>
	<lastBuildDate>Tue, 31 Jan 2012 19:37:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>&#8220;Please provide path to Windows media (x86 processor)&#8221; when installing printer</title>
		<link>http://www.lejordet.com/2011/01/please-provide-path-to-windows-media-x86-processor-when-installing-printer/</link>
		<comments>http://www.lejordet.com/2011/01/please-provide-path-to-windows-media-x86-processor-when-installing-printer/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 19:45:39 +0000</pubDate>
		<dc:creator>Lars Erik Jordet</dc:creator>
				<category><![CDATA[windows]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[2008r2]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[printer]]></category>
		<category><![CDATA[r2]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[win64]]></category>

		<guid isPermaLink="false">http://www.lejordet.com/?p=130</guid>
		<description><![CDATA[Trying to install the x86 printer driver for some printers on Windows Server 2008 R2 prompts you for the path to x86 media, with no indication of which media it actually means. This is how to fix it.]]></description>
			<content:encoded><![CDATA[<p>When installing a new printer earlier, I first installed it in Windows Server 2008 R2 (which of course only exists in a x64 version), and tried to add the x86 (XP) driver since all the clients run XP.</p>
<p>After providing the &#8220;additional drivers&#8221;-wizard with the printer driver, it asked me to &#8220;Please provide path to Windows media (x86 processor)&#8221;, which was a bit difficult since I had no 32-bit media (I would have tried 2008 32bit or similar, if so).</p>
<p>Turns out, the solution is blindingly simple: Share the printer, and with an admin user (typically the same who installed the printer on the server), log on to an XP computer, and install the shared printer from there. It will ask you to provide the driver since the server has none. After installing, go into printer properties in XP, find Sharing, Additional drivers&#8230;, and check off &#8220;Windows XP/2000, x86&#8243;. The driver will be uploaded to the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejordet.com/2011/01/please-provide-path-to-windows-media-x86-processor-when-installing-printer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8220;Microsoft Dynamics CRM for Outlook with Offline Access has already been configured for a user on this computer. Only one use can be configured per computer for Microsoft CRM for Outlook with Offline Access.&#8221;</title>
		<link>http://www.lejordet.com/2010/09/microsoft-dynamics-crm-for-outlook-with-offline-access-has-already-been-configured-for-a-user-on-this-computer-only-one-use-can-be-configured-per-computer-for-microsoft-crm-for-outlook-with-offline/</link>
		<comments>http://www.lejordet.com/2010/09/microsoft-dynamics-crm-for-outlook-with-offline-access-has-already-been-configured-for-a-user-on-this-computer-only-one-use-can-be-configured-per-computer-for-microsoft-crm-for-outlook-with-offline/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 11:46:57 +0000</pubDate>
		<dc:creator>Lars Erik Jordet</dc:creator>
				<category><![CDATA[office]]></category>
		<category><![CDATA[quick]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[dynamics]]></category>
		<category><![CDATA[win32]]></category>

		<guid isPermaLink="false">http://www.lejordet.com/?p=126</guid>
		<description><![CDATA["Microsoft Dynamics CRM for Outlook with Offline Access has already been configured for a user on this computer. Only one use can be configured per computer for Microsoft CRM for Outlook with Offline Access." - how to configure Dynamics for a different user.]]></description>
			<content:encoded><![CDATA[<p>If you try to swap users on a laptop, with Dynamics CRM installed in Offline Access mode, it will give the error above; searching gave me 
<a  href="http://blogs.technet.com/b/crmchina/archive/2010/06/04/quot-microsoft-dynamics-crm-for-outlook-with-offline-access-has-already-been-configured-for-a-user-on-this-computer-only-one-use-can-be-configured-per-computer-for-microsoft-crm-for-outlook-with-offline-access-quot.aspx" onclick="javascript:pageTracker._trackPageview('/external/blogs.technet.com/b/crmchina/archive/2010/06/04/quot-microsoft-dynamics-crm-for-outlook-with-offline-access-has-already-been-configured-for-a-user-on-this-computer-only-one-use-can-be-configured-per-computer-for-microsoft-crm-for-outlook-with-offline-access-quot.aspx');" >this page from the Chinese Dynamics CRM team</a>, so I&#8217;m just going to repeat it here:</p>
<div class="codecolorer-container dos blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; C:\<span style="color: #33cc33;">&gt;</span>osql –E –S localhost\CRM<br />
&nbsp; &nbsp; &nbsp; 1<span style="color: #33cc33;">&gt;</span> drop database mscrm_msde<br />
&nbsp; &nbsp; &nbsp; 2<span style="color: #33cc33;">&gt;</span> go<br />
&nbsp; &nbsp; &nbsp; 1<span style="color: #33cc33;">&gt;</span> quit</div></td></tr></tbody></table></div>
<p>Basically, you connect to the SQL Server on the local computer, and delete the Offline Access database, allowing you to reconfigure as normal. Note that this won&#8217;t let you reconfigure the user as &#8220;online only&#8221; &#8211; the new configuration will automatically be Offline Access.</p>
<p>Secondly, this works even if the user is not Local Administrator on the computer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejordet.com/2010/09/microsoft-dynamics-crm-for-outlook-with-offline-access-has-already-been-configured-for-a-user-on-this-computer-only-one-use-can-be-configured-per-computer-for-microsoft-crm-for-outlook-with-offline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script to add a network printer automatically in Windows</title>
		<link>http://www.lejordet.com/2010/08/script-to-add-a-network-printer-automatically-in-windows/</link>
		<comments>http://www.lejordet.com/2010/08/script-to-add-a-network-printer-automatically-in-windows/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 08:47:04 +0000</pubDate>
		<dc:creator>Lars Erik Jordet</dc:creator>
				<category><![CDATA[quick]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[install printer]]></category>
		<category><![CDATA[printer]]></category>
		<category><![CDATA[win32]]></category>

		<guid isPermaLink="false">http://www.lejordet.com/?p=120</guid>
		<description><![CDATA[Batch script to install or replace a Windows network printer]]></description>
			<content:encoded><![CDATA[<p>I recently had to replace a defective printer with a similar model, but different enough to need a new driver. This meant it would have a new name on the print server, and I had to figure out a way to replace the installed printer on each computer quickly. After some searching, I ended up with the following script:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">@echo off<br />
set OLDPRINTER=&quot;\\printserver\Xerox Phaser 8560N&quot;<br />
set NEWPRINTER=&quot;\\printserver\Xerox Phaser 8560DN PS&quot;<br />
rundll32 printui.dll,PrintUIEntry /q /dn /n%OLDPRINTER%<br />
rundll32 printui.dll,PrintUIEntry /in /n%NEWPRINTER% /q<br />
rundll32 printui.dll,PrintUIEntry /y /n%NEWPRINTER%</div></td></tr></tbody></table></div>
<p>The first rundll32 line quietly (/q) deletes (/dn) the printer named (/n) %OLDPRINTER%, while the second line installs (/in) the new printer %NEWPRINTER%, and the final line sets the new printer as default (/y)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejordet.com/2010/08/script-to-add-a-network-printer-automatically-in-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Couldn&#8217;t generate the upgrade script.&#8221; for version C.0.8.40 of MS SQL Reporting Services</title>
		<link>http://www.lejordet.com/2010/07/couldnt-generate-the-upgrade-script-for-version-c-0-8-40-of-ms-sql-reporting-services/</link>
		<comments>http://www.lejordet.com/2010/07/couldnt-generate-the-upgrade-script-for-version-c-0-8-40-of-ms-sql-reporting-services/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 08:51:42 +0000</pubDate>
		<dc:creator>Lars Erik Jordet</dc:creator>
				<category><![CDATA[quick]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[mssql2005]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.lejordet.com/?p=104</guid>
		<description><![CDATA[The error message &#8220;Couldn&#8217;t generate the upgrade script&#8221; pops up during configuration of Reporting Services for MS SQL Server 2005, if you install reporting services after installing a service pack &#8211; in my case Reporting Services was installed as SP1, while the main SQL Server 2005 install was updated to SP3. Reinstalling SQL Server 2005 SP3 [...]]]></description>
			<content:encoded><![CDATA[<p>The error message &#8220;Couldn&#8217;t generate the upgrade script&#8221; pops up during configuration of Reporting Services for MS SQL Server 2005, if you install reporting services after installing a service pack &#8211; in my case Reporting Services was installed as SP1, while the main SQL Server 2005 install was updated to SP3.</p>
<p>Reinstalling 
<a  href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ae7387c3-348c-4faa-8ae5-949fdfbe59c4&amp;displaylang=en" onclick="javascript:pageTracker._trackPageview('/external/www.microsoft.com/downloads/details.aspx');" >SQL Server 2005 SP3</a> fixed it.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.lejordet.com%2F2010%2F07%2Fcouldnt-generate-the-upgrade-script-for-version-c-0-8-40-of-ms-sql-reporting-services%2F&amp;title=%26%238220%3BCouldn%26%238217%3Bt%20generate%20the%20upgrade%20script.%26%238221%3B%20for%20version%20C.0.8.40%20of%20MS%20SQL%20Reporting%20Services" id="wpa2a_2"><img src="http://www.lejordet.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.lejordet.com/2010/07/couldnt-generate-the-upgrade-script-for-version-c-0-8-40-of-ms-sql-reporting-services/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mercurial module for Python 2.6/Win32</title>
		<link>http://www.lejordet.com/2010/06/mercurial-module-for-python-2-6win32/</link>
		<comments>http://www.lejordet.com/2010/06/mercurial-module-for-python-2-6win32/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 09:44:43 +0000</pubDate>
		<dc:creator>Lars Erik Jordet</dc:creator>
				<category><![CDATA[compiling]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[hg]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[python2.6]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.lejordet.com/?p=102</guid>
		<description><![CDATA[Precompiled Mercurial 1.5.4 for Python 2.6]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve compiled Mercurial 1.5.4 for Python 2.6, following 
<a  href="http://mercurial.selenic.com/wiki/WindowsInstall" onclick="javascript:pageTracker._trackPageview('/external/mercurial.selenic.com/wiki/WindowsInstall');" >this guide</a>, and uploaded it here, since I guess it&#8217;ll be useful for later:</p>
<p>
<a  href="/files/python/mercurial-1.5.4.win32-py2.6.exe" onclick="javascript:pageTracker._trackPageview('/downloads/files/python/mercurial-1.5.4.win32-py2.6.exe');" >mercurial-1.5.4.win32-py2.6.exe</a></p>
<p>I use it for 
<a  href="http://trac.edgewall.org" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org');" >Trac 0.12</a> in a multi-repository setting, so we can keep our old SVN repo while having some of the larger projects on Hg.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejordet.com/2010/06/mercurial-module-for-python-2-6win32/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making a Trac install work on Apache 2.2/Python 2.6/win32, 2010 edition</title>
		<link>http://www.lejordet.com/2010/01/making-a-trac-install-work-on-apache-2-2python-2-6win32-2010-edition/</link>
		<comments>http://www.lejordet.com/2010/01/making-a-trac-install-work-on-apache-2-2python-2-6win32-2010-edition/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 11:14:25 +0000</pubDate>
		<dc:creator>Lars Erik Jordet</dc:creator>
				<category><![CDATA[windows]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[python2.6]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[win32]]></category>

		<guid isPermaLink="false">http://www.lejordet.com/?p=98</guid>
		<description><![CDATA[A year ago making Trac work on Python 2.6/win32 was a lot of work, including having to compile your own Python SVN bindings. This is an update of that old article assuming the usage of pre-built PySVN bindings.]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: normal;">About 10 months ago I wrote a 
<a  href="http://www.lejordet.com/2009/03/making-a-trac-install-work-on-apache-22python-26win32/">short article</a> on getting 
<a title="Trac"  href="http://trac.edgewall.org/" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org/');" >Trac</a> to work on Python 2.6 and Windows. Recently I updated the install, and took a look at how the situation is now.</span></p>
<p>This guide assumes you have a working install of Trac on Python 2.5/mod_python/Apache2.2 already, as described in the 
<a  href="http://trac.edgewall.org/wiki/TracInstall" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org/wiki/TracInstall');" >Trac install guide</a>, and that 
<a  href="http://www.python.org/download/releases/2.6.4/" onclick="javascript:pageTracker._trackPageview('/external/www.python.org/download/releases/2.6.4/');" >Python 2.6</a> is installed.</p>
<p>What needs to be done:</p>
<ul>
<li>Install Python 2.6 and Trac for 2.6</li>
<li>Build a new version of mod_python</li>
<li>Optionally Replace Apache DLLs (mostly if you followed my previous guide)</li>
</ul>
<h2>Required software</h2>
<p>You&#8217;ll need 
<a  href="http://www.microsoft.com/express/vc/" onclick="javascript:pageTracker._trackPageview('/external/www.microsoft.com/express/vc/');" >Visual C++ 2008 Express Edition</a> or any retail version of VS 2008 if you want to build your own mod_python for 2.6 (I&#8217;ll provide a precompiled one in this post).</p>
<h2>Preparing</h2>
<p>Install Python 2.6 and 
<a  href="http://trac.edgewall.org/wiki/TracInstall" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org/wiki/TracInstall');" >Trac on 2.6</a> (using &#8220;
<a  href="http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install" onclick="javascript:pageTracker._trackPageview('/external/peak.telecommunity.com/DevCenter/EasyInstall?installing-easy-install');" >easy_install</a> trac&#8221; is recommended)</p>
<p>You&#8217;ll probably also want to easy_install 
<a  href="http://pygments.org/" onclick="javascript:pageTracker._trackPageview('/external/pygments.org/');" >Pygments</a> for source highlighting.</p>
<h2>Building mod_python for 2.6</h2>
<p>This 
<a  href="http://badwords.org/w/Compile_mod_python_for_Python_2.6.1" onclick="javascript:pageTracker._trackPageview('/external/badwords.org/w/Compile_mod_python_for_Python_2.6.1');" >guide to mod_python</a> covers the creation and installation of a compatible version of the module.</p>
<p>At this point, you should be able to restart Apache and load up your &#8220;old&#8221; Trac on Python 2.6, but with the error message that &#8220;svn&#8221; support is not installed.</p>
<p>A pre-built version of this can be found here: 
<a  href="http://vagabonds.info/python/mod_python-3.3.2-dev-20080819.win32-py2.6.exe" onclick="javascript:pageTracker._trackPageview('/external/vagabonds.info/python/mod_python-3.3.2-dev-20080819.win32-py2.6.exe');" >mod_python-3.3.2-dev-20080819.win32-py2.6.exe</a></p>
<h2>Python SVN bindings</h2>
<p>My 
<a  href="http://www.lejordet.com/2009/03/making-a-trac-install-work-on-apache-22python-26win32/">old guide</a> had instructions on how to build these yourself, but after that article was made, 
<a  href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100" onclick="javascript:pageTracker._trackPageview('/external/subversion.tigris.org/servlets/ProjectDocumentList');" >&#8220;official&#8221; Python 2.6 bindings</a> have been released.</p>
<p>Most recent version as of this writing is the 
<a  href="http://subversion.tigris.org/files/documents/15/46888/svn-python-1.6.6.win32-py2.6.exe" onclick="javascript:pageTracker._trackPageview('/external/subversion.tigris.org/files/documents/15/46888/svn-python-1.6.6.win32-py2.6.exe');" >SVN 1.6.6 version of the bindings</a>.</p>
<h2>Replacing Apache DLLs to make libsvn work</h2>
<p><em>Note: Only use these instructions if you experience problems, and/or you&#8217;re running a self-built version of the Python SVN bindings already.</em></p>
<p>There&#8217;s a slight difference between libapr-1.dll as supplied with Apache 2.2 and the one we built together with libsvn, so 
<a  href="http://trac.edgewall.org/ticket/6739#comment:9" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org/ticket/6739?comment:9');" >the fix</a> is to replace the one in your Apache2.2\bin folder with the one from your Python2.6\Lib\site-packages\libsvn folder (copy the libsvn_*.dlls from the same folder into the Apache2.2\bin folder if you still get problems).</p>
<p>Restarting Apache now should make Trac work fully, with Subversion support.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejordet.com/2010/01/making-a-trac-install-work-on-apache-2-2python-2-6win32-2010-edition/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>lxml for Python 2.6/win32</title>
		<link>http://www.lejordet.com/2009/12/lxml-for-python26-win32/</link>
		<comments>http://www.lejordet.com/2009/12/lxml-for-python26-win32/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 12:03:35 +0000</pubDate>
		<dc:creator>Lars Erik Jordet</dc:creator>
				<category><![CDATA[packages]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[python2.6]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.lejordet.com/?p=95</guid>
		<description><![CDATA[A pre-built statically linked lxml 2.2.4 for Windows/Python 2.6]]></description>
			<content:encoded><![CDATA[<p>A quick post today: Using 
<a  href="http://codespeak.net/lxml/build.html" onclick="javascript:pageTracker._trackPageview('/external/codespeak.net/lxml/build.html');" >these instructions</a>, I&#8217;ve built a statically linked lxml 2.2.4 for Windows.</p>
<p>I used the following versions of the libraries:</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">STATIC_INCLUDE_DIRS <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><br />
<span style="color: #483d8b;">&quot;..<span style="color: #000099; font-weight: bold;">\\</span>libxml2-2.7.6.win32<span style="color: #000099; font-weight: bold;">\\</span>include&quot;</span><span style="color: #66cc66;">,</span><br />
<span style="color: #483d8b;">&quot;..<span style="color: #000099; font-weight: bold;">\\</span>libxslt-1.1.26.win32<span style="color: #000099; font-weight: bold;">\\</span>include&quot;</span><span style="color: #66cc66;">,</span><br />
<span style="color: #483d8b;">&quot;..<span style="color: #000099; font-weight: bold;">\\</span>zlib-1.2.3.win32<span style="color: #000099; font-weight: bold;">\\</span>include&quot;</span><span style="color: #66cc66;">,</span><br />
<span style="color: #483d8b;">&quot;..<span style="color: #000099; font-weight: bold;">\\</span>iconv-1.9.2.win32<span style="color: #000099; font-weight: bold;">\\</span>include&quot;</span><br />
<span style="color: black;">&#93;</span></div></td></tr></tbody></table></div>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">STATIC_LIBRARY_DIRS <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><br />
<span style="color: #483d8b;">&quot;..<span style="color: #000099; font-weight: bold;">\\</span>libxml2-2.7.6.win32<span style="color: #000099; font-weight: bold;">\\</span>lib&quot;</span><span style="color: #66cc66;">,</span><br />
<span style="color: #483d8b;">&quot;..<span style="color: #000099; font-weight: bold;">\\</span>libxslt-1.1.26.win32<span style="color: #000099; font-weight: bold;">\\</span>lib&quot;</span><span style="color: #66cc66;">,</span><br />
<span style="color: #483d8b;">&quot;..<span style="color: #000099; font-weight: bold;">\\</span>zlib-1.2.3.win32<span style="color: #000099; font-weight: bold;">\\</span>lib&quot;</span><span style="color: #66cc66;">,</span><br />
<span style="color: #483d8b;">&quot;..<span style="color: #000099; font-weight: bold;">\\</span>iconv-1.9.2.win32<span style="color: #000099; font-weight: bold;">\\</span>lib&quot;</span><br />
<span style="color: black;">&#93;</span></div></td></tr></tbody></table></div>
<p>Download it here: 
<a  href="/files/python/lxml-2.2.4.win32-py2.6.exe" onclick="javascript:pageTracker._trackPageview('/downloads/files/python/lxml-2.2.4.win32-py2.6.exe');" >lxml-2.2.4.win32-py2.6</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejordet.com/2009/12/lxml-for-python26-win32/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple Python ctypes Example &#8211; in Windows</title>
		<link>http://www.lejordet.com/2009/04/simple-python-ctypes-example-in-windows/</link>
		<comments>http://www.lejordet.com/2009/04/simple-python-ctypes-example-in-windows/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 08:56:11 +0000</pubDate>
		<dc:creator>Lars Erik Jordet</dc:creator>
				<category><![CDATA[compiling]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[ctypes]]></category>
		<category><![CDATA[dll]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.lejordet.com/?p=27</guid>
		<description><![CDATA[I found this blog post, Simple Python ctypes Example, on Reddit, and thought I'd see how different the procedure was for Windows. As it turns out, it was fairly similar.]]></description>
			<content:encoded><![CDATA[<p>I found this blog post, 
<a  href="http://fsckd.com/2009/4/25/simple-python-ctypes-example/" onclick="javascript:pageTracker._trackPageview('/external/fsckd.com/2009/4/25/simple-python-ctypes-example/');" >Simple Python ctypes Example</a>, on 
<a  href="http://www.reddit.com/r/programming/" onclick="javascript:pageTracker._trackPageview('/external/www.reddit.com/r/programming/');" >Reddit</a>, and thought I&#8217;d see how different the procedure was for Windows.</p>
<h2>What you&#8217;ll need:</h2>
<ul>
<li>
<a  href="http://www.microsoft.com/express/vc/" onclick="javascript:pageTracker._trackPageview('/external/www.microsoft.com/express/vc/');" >Visual C# 2008 Express Edition</a> (Visual Studio 2008 will also work &#8211; and is what I used, but will again base this on free downloads)</li>
<li>
<a  href="http://www.python.org" onclick="javascript:pageTracker._trackPageview('/external/www.python.org');" >Python</a> 2.5 or higher (I used Python 2.6.2)</li>
</ul>
<h2>Creating the DLL</h2>
<p>Create a file <tt>dlltest.c</tt> with the following content:</p>
<div class="codecolorer-container c blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">#include &lt;windows.h&gt;</span><br />
<br />
BOOL APIENTRY DllMain<span style="color: #009900;">&#40;</span>HANDLE hModule<span style="color: #339933;">,</span> DWORD dwReason<span style="color: #339933;">,</span> LPVOID lpReserved<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">return</span> TRUE<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
__declspec<span style="color: #009900;">&#40;</span>dllexport<span style="color: #009900;">&#41;</span> <span style="color: #993333;">int</span><br />
multiply<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> num1<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> num2<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">return</span> num1 <span style="color: #339933;">*</span> num2<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Start the <strong>Visual Studio 2008 Command Prompt </strong>from the Start Menu (this sets up the path for the compiler and other files, which makes things easier) and go to the directory you saved dlltest.c to.</p>
<p>Compile it with the following command:</p>
<pre>cl -LD dlltest.c -Fetest.dll</pre>
<h2>Testing the DLL</h2>
<p>As in the original Linux example, this DLL is easily tested using similar commands:</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">from</span> ctypes <span style="color: #ff7700;font-weight:bold;">import</span> *<br />
<span style="color: #66cc66;">&gt;&gt;&gt;</span> libtest <span style="color: #66cc66;">=</span> cdll.<span style="color: black;">LoadLibrary</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'test.dll'</span><span style="color: black;">&#41;</span><br />
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">print</span> libtest.<span style="color: black;">multiply</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: #66cc66;">,</span> <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span><br />
<span style="color: #ff4500;">4</span></div></td></tr></tbody></table></div>
<p>So, that is the simplest DLL possible, I&#8217;ll look at (same as the original blog post) applying it to more complex examples later.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejordet.com/2009/04/simple-python-ctypes-example-in-windows/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Patched libgmail for unicode handling</title>
		<link>http://www.lejordet.com/2009/04/patched-libgmail-for-unicode-handling/</link>
		<comments>http://www.lejordet.com/2009/04/patched-libgmail-for-unicode-handling/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 09:28:51 +0000</pubDate>
		<dc:creator>Lars Erik Jordet</dc:creator>
				<category><![CDATA[packages]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[installer]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.lejordet.com/?p=18</guid>
		<description><![CDATA[Packages and Windows installer for patched libgmail-0.1.11 to fix a unicode handling bug]]></description>
			<content:encoded><![CDATA[<p>
<a title="libgmail"  href="http://libgmail.sourceforge.net/" onclick="javascript:pageTracker._trackPageview('/external/libgmail.sourceforge.net/');" >libgmail</a> 0.1.11 has a 
<a title="libgmail unicode bug"  href="http://sourceforge.net/tracker/?func=detail&amp;aid=2643866&amp;group_id=113492&amp;atid=665330" onclick="javascript:pageTracker._trackPageview('/external/sourceforge.net/tracker/');" >bug with unicode handling</a>, when the sender of an email has a name with one or more non-ASCII character in it.</p>
<p>I&#8217;ve applied the patch I described in the link above, adding the function:</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">def</span> to_unicode<span style="color: black;">&#40;</span>xstr<span style="color: black;">&#41;</span>:<br />
    <span style="color: #483d8b;">'''<br />
    Forces string to unicode<br />
    '''</span><br />
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>xstr<span style="color: black;">&#41;</span> <span style="color: #66cc66;">==</span> <span style="color: #008000;">unicode</span>:<br />
        <span style="color: #ff7700;font-weight:bold;">return</span> xstr<br />
    <span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>xstr<span style="color: black;">&#41;</span> <span style="color: #66cc66;">==</span> <span style="color: #008000;">str</span>:<br />
        <span style="color: #ff7700;font-weight:bold;">return</span> xstr.<span style="color: black;">decode</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'utf-8'</span><span style="color: black;">&#41;</span><br />
    <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
        <span style="color: #ff7700;font-weight:bold;">return</span> xstr</div></td></tr></tbody></table></div>
<p>And changed all calls to var.decode(&#8216;utf-8&#8242;) to to_unicode(var).</p>
<p>
<a  href="http://vagabonds.info/python/libgmail-0.1.11p1.zip" onclick="javascript:pageTracker._trackPageview('/external/vagabonds.info/python/libgmail-0.1.11p1.zip');" >libgmail-0.1.11p1.zip</a> (source package)<br />

<a  href="http://vagabonds.info/python/libgmail-0.1.11p1.win32.exe" onclick="javascript:pageTracker._trackPageview('/external/vagabonds.info/python/libgmail-0.1.11p1.win32.exe');" >libgmail-0.1.11p1.win32.exe</a> (win32 installer)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejordet.com/2009/04/patched-libgmail-for-unicode-handling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making a Trac install work on Apache 2.2/Python 2.6/win32</title>
		<link>http://www.lejordet.com/2009/03/making-a-trac-install-work-on-apache-22python-26win32/</link>
		<comments>http://www.lejordet.com/2009/03/making-a-trac-install-work-on-apache-22python-26win32/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 11:52:40 +0000</pubDate>
		<dc:creator>Lars Erik Jordet</dc:creator>
				<category><![CDATA[compiling]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[python2.6]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.lejordet.com/?p=11</guid>
		<description><![CDATA[Updating to Python 2.6 and keeping Trac working is problematic since there is no "official" libsvn nor mod_python for 2.6 yet. This guide summarizes the steps needed to get Trac up and running again.]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: normal;">I recently upgraded the systems to Python 2.6, and the worst part of that was getting 
<a title="Trac"  href="http://trac.edgewall.org/" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org/');" >Trac</a> to work again.</span></p>
<p>This guide assumes you have a working install of Trac on Python 2.5/mod_python/Apache2.2 already, as described in the 
<a  href="http://trac.edgewall.org/wiki/TracInstall" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org/wiki/TracInstall');" >Trac install guide</a>, and that 
<a  href="http://www.python.org/download/releases/2.6.1/" onclick="javascript:pageTracker._trackPageview('/external/www.python.org/download/releases/2.6.1/');" >Python 2.6</a> is installed.</p>
<p>What needs to be done:</p>
<ul>
<li>Install Python 2.6 and Trac for 2.6</li>
<li>Build a new version of mod_python</li>
<li>Build a new version of libsvn</li>
<li>Replace Apache DLLs</li>
</ul>
<h2>Required software</h2>
<p>You&#8217;ll need 
<a  href="http://www.microsoft.com/express/vc/" onclick="javascript:pageTracker._trackPageview('/external/www.microsoft.com/express/vc/');" >Visual C++ 2008 Express Edition</a> or any retail version of VS 2008.</p>
<h2>Preparing</h2>
<p>Install Python 2.6 and 
<a  href="http://trac.edgewall.org/wiki/TracInstall" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org/wiki/TracInstall');" >Trac on 2.6</a> (using &#8220;
<a  href="http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install" onclick="javascript:pageTracker._trackPageview('/external/peak.telecommunity.com/DevCenter/EasyInstall?installing-easy-install');" >easy_install</a> trac&#8221; is recommended)</p>
<p>You&#8217;ll probably also want to easy_install 
<a  href="http://pygments.org/" onclick="javascript:pageTracker._trackPageview('/external/pygments.org/');" >Pygments</a> for source highlighting.</p>
<h2>Building mod_python for 2.6</h2>
<p>This 
<a  href="http://badwords.org/w/Compile_mod_python_for_Python_2.6.1" onclick="javascript:pageTracker._trackPageview('/external/badwords.org/w/Compile_mod_python_for_Python_2.6.1');" >guide to mod_python</a> covers the creation and installation of a compatible version of the module.</p>
<p>At this point, you should be able to restart Apache and load up your &#8220;old&#8221; Trac on Python 2.6, but with the error message that &#8220;svn&#8221; support is not installed.</p>
<p>A pre-built version of this can be found here: 
<a  href="http://vagabonds.info/python/mod_python-3.3.2-dev-20080819.win32-py2.6.exe" onclick="javascript:pageTracker._trackPageview('/external/vagabonds.info/python/mod_python-3.3.2-dev-20080819.win32-py2.6.exe');" >mod_python-3.3.2-dev-20080819.win32-py2.6.exe</a></p>
<h2>Building svn/libsvn for Python 2.6</h2>
<p>Follow my previous 
<a  href="http://www.lejordet.com/?p=3">guide to compile and install Python SVN bindings</a>.</p>
<p>At this point, if you restart Apache, your Trac will most likely throw an exception about &#8220;_mod&#8221; being undefined.</p>
<h2>Replacing Apache DLLs to make libsvn work</h2>
<p>There&#8217;s a slight difference between libapr-1.dll as supplied with Apache 2.2 and the one we built together with libsvn, so 
<a  href="http://trac.edgewall.org/ticket/6739#comment:9" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org/ticket/6739?comment:9');" >the fix</a> is to replace the one in your Apache2.2\bin folder with the one you built yourself, and copying all the libsvn*.dll files you built in the previous step to the same folder.</p>
<p>Restarting Apache now should make Trac work fully, with Subversion support.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejordet.com/2009/03/making-a-trac-install-work-on-apache-22python-26win32/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
