Archive for May, 2008

Coming to an End

Today , we will install the software to our client.

What will happen ?

I hate to think what’s next

Deja Vu

I have the strangest feeling that I have been at this situation before.

Does my mind play tricks on me ?

Or is it real ?

Disable Adobe CS3 Auto Update

Today I finally figure out how to disable Adobe CS3 auto update feature, it’s been bugging me ever since.

It’s describe at http://www.adobe.com/go/kb402251

Essentially you need to manually edit your AdobeUpdaterPrefs.dat located in …\Documents and Settings\[username]\Local Settings\Application Data\Adobe\Updater5

Add <AutoCheck>0</AutoCheck> in it

Rapidshare Capcha

After wondering what is “having a below means”, finally I realize that the new rapidshare captcha is for letters with cats imprinted on them. Damn, I feel so stupid.

Sleepy Heads

Humpty Dumpty on the wall, oh I wonder where you are

Sleepy head on my shoulder

Why do you sleep at 2 in the morning?

Empty Blog

Write everyday about anything, the most important is to write.

What to write?

Who will read?

Wake Up

Wake up 5 in the morning, close my eyes 8 in the morning

Why am I feeling so sleepy now

Maybe because I don’t get enough sleep.

Is there a better way to generate PDFs ?

In the current project I am doing, we need to create a print out sheet. So we’ve decided to export it into a pdf document and let the user print this pdf.

But creating pdf document requires setting x, y just like drawing in programming language, it’s time consuming and boring as hell. Isn’t there another better method to produce a pdf document ?

Can someone help ?

Visual Studio 2008, MSBuild and NAnt 0.85

I’ve installed NAnt 0.85 expecting it to work immediately in compiling MSBuild task. Unfortunately I painfully discovered that it doesn’t work like that. The MSBuild task produced an error complaining that .Net framework 2.0 failed.

It turns out that Visual Studio 2008 solutions standardly compiles to .Net framework 3.5 and NAnt 0.85 only compiles to .Net 2.0. After trying to find out where is exactly in the NAnt build file that specify the .Net version, it turns out that the settings is in nant.exe.config in NAnt /bin directory.

If you happens to find the same problem, you need to add the following code in nant.exe.config :

        <framework
       name="net-3.5"
       family="net"
       version="3.5"
       description="Microsoft .NET Framework 3.5"
       runtimeengine=""
       sdkdirectory="${path::combine(sdkInstallRoot, ‘bin’)}"
       frameworkdirectory="${path::combine(installRoot, ‘v3.5′)}"
       frameworkassemblydirectory="${path::combine(installRoot, ‘v2.0.50727′)}"
       clrversion="2.0.50727"
                    >

          <task-assemblies>

            <!– include .NET specific assemblies –>

            <include name="tasks/net/*.dll" />

            <!– include .NET 2.0 specific assemblies –>

            <include name="tasks/net/2.0/**/*.dll" />

            <!– include Microsoft.NET specific task assembly –>

            <include name="NAnt.MSNetTasks.dll" />

            <!– include Microsoft.NET specific test assembly –>

            <include name="NAnt.MSNet.Tests.dll" />

          </task-assemblies>

          <project>

            <readregistry

property="installRoot"

key="SOFTWARE\Microsoft\.NETFramework\InstallRoot"

hive="LocalMachine" />

            <readregistry

property="sdkInstallRoot"

key="SOFTWARE\Microsoft\.NETFramework\sdkInstallRootv2.0"

hive="LocalMachine"

failonerror="false" />

          </project>

          <tasks>

            <task name="csc">

              <attribute name="exename">csc</attribute>

              <attribute name="supportsnowarnlist">true</attribute>

              <attribute name="supportswarnaserrorlist">true</attribute>

              <attribute name="supportskeycontainer">true</attribute>

              <attribute name="supportskeyfile">true</attribute>

              <attribute name="supportsplatform">true</attribute>

              <attribute name="supportslangversion">true</attribute>

            </task>

            <task name="vbc">

              <attribute name="exename">vbc</attribute>

              <attribute name="supportsdocgeneration">true</attribute>

              <attribute name="supportsnostdlib">true</attribute>

              <attribute name="supportsnowarnlist">true</attribute>

              <attribute name="supportskeycontainer">true</attribute>

              <attribute name="supportskeyfile">true</attribute>

              <attribute name="supportsplatform">true</attribute>

              <attribute name="supportswarnaserrorlist">true</attribute>

            </task>

            <task name="jsc">

              <attribute name="exename">jsc</attribute>

              <attribute name="supportsplatform">true</attribute>

            </task>

            <task name="vjc">

              <attribute name="exename">vjc</attribute>

              <attribute name="supportsnowarnlist">true</attribute>

              <attribute name="supportskeycontainer">true</attribute>

              <attribute name="supportskeyfile">true</attribute>

            </task>

            <task name="resgen">

              <attribute name="exename">resgen</attribute>

              <attribute name="supportsassemblyreferences">true</attribute>

              <attribute name="supportsexternalfilereferences">true</attribute>

            </task>

            <task name="al">

              <attribute name="exename">al</attribute>

            </task>

            <task name="delay-sign">

              <attribute name="exename">sn</attribute>

            </task>

            <task name="license">

              <attribute name="exename">lc</attribute>

              <attribute name="supportsassemblyreferences">true</attribute>

            </task>

            <task name="ilasm">

              <attribute name="exename">ilasm</attribute>

            </task>

            <task name="ildasm">

              <attribute name="exename">ildasm</attribute>

            </task>

          </tasks>

        </framework>

Visual Studio 2008 and NAnt

Most article suggest to script a build task using NAnt so that you can build your application from the command line. But why repeat yourself when the Visual Studio 2008 has already build it’s solution for you. Isn’t it doesn’t conform to the DRY principle?

So, in order to make NAnt and VS 2008 work together DRY-ly. We are going to need NAntContrib. So after you download NAnt Contrib, install it together with NAnt (I recommend their install method #2).

Here it is:

2. Copy the content of the NAntContrib bin directory to the NAnt directory

In order to make certain tasks available to every build file, you can copy the tasks assembly and
all its non-assembly dependencies to the "<nant>\bin\tasks" directory, and copy the assembly
dependencies to the "<nant>\bin\lib" directory.

However, as NAntContrib contains tasks that rely on COM Interop, it is only supported on the .NET
Framework (not on Mono). So, in order to avoid issues when running NAnt on Mono, you should copy
the content of the NAntContrib bin directory to "<nant>\bin\tasks\net" and "<nant>\bin\lib\net".
This will ensure that NAnt only loads the NAntContrib tasks when running on one of the MS .NET
Framework runtimes.

You should eventually end up with the following directory structure:

<nant>\
    bin\
        lib\
            net\
                CollectionGen.dll
                Interop.MsmMergeTypeLib.dll
                Interop.StarTeam.dll
                Interop.WindowsInstaller.dll
                SourceSafe.Interop.dll

        tasks\
            net\
                MSITaskErrors.mst
                MSITaskTemplate.msi
                MSMTaskErrors.mst
                MSMTaskTemplate.msm
                NAnt.Contrib.Tasks.dll
                NAnt.Contrib.Tasks.pdb (not available for releases)
                NAnt.Contrib.Tasks.xml

        SLiNgshoT.Core.dll
        SLiNgshoT.exe

Note: you might have to manually create the "tasks\net" and "lib\net" directories.

References