2008-06-22

Windows XP Manifest File Maker

Windows XP has introduced a new theming API. You can make your applications to use this new theming API by the use of a .manifest file. This manifest file can sit alongside your application or in your applications resource part.

Here is a batch file which creates such a manifest file:

@echo off

rem (c) 2008 Cristian Adam

if [%1] == [] (

echo Usage: make_manifest file.exe

) else (

if exist %1.manifest goto :EOF

echo ^<?xml version="1.0" encoding="UTF-8" standalone="yes" ?^> >> %1.manifest
echo ^<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"^> >> %1.manifest
echo ^<description^>Windows Forms Common Control manifest^</description^> >> %1.manifest
echo ^<dependency^> >> %1.manifest
echo ^<dependentAssembly^> >> %1.manifest
echo ^<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" /^> >> %1.manifest
echo ^</dependentAssembly^> >> %1.manifest
echo ^</dependency^> >> %1.manifest
echo ^</assembly^> >> %1.manifest

)


And now a screenshot to show the before and after state:

2008-06-15

First release of oggcodecs

I've released my first release of oggcodecs:

Current UNSTABLE Version (0.80.15039) - 14.06.2008
Changes this version

* Support for Microsoft Windows Vista
* Updated compiler to Visual Studio 2008 Express, which drops support for Windows 9x, NT 4.
* Updated libspeex to version 1.2 beta 1
* Updated libvorbis to version 1.2.1 (20080501)
* Updated libogg to version 1.1.3
* Updated libtheora to version 1.0beta3 (20080416)
* Updated libFLAC to version 1.2.1
* Fixed crash at the end of incomplete Theora files.

2008-06-12

Google Translate Learned Romanian

I found out recently that Google translate knows how to translate from Romanian to English and from English to Romanian.

I've used Goosh - Google Shell - to translate a quote from a previous post:

guest@goosh.org:/web> translate en ro This is a great victory for the glorious people of Romania!
translating "This is a great victory for the glorious people of Romania!" from "english" to "romanian":

"Aceasta este o mare victorie pentru oamenii de glorie a Romaniei!"


It's pretty good, with time it will become better :-)

2008-06-11

Why Microsoft? Why?!

Take the cab file format. It's present on every windows from Windows 95. If you use the LZW compression algorithm you get small archives.
986.875 oggcodecs.7z
1.150.890 oggcodecs.cab
1.618.917 oggcodecs.zip

It's better than zip and a bit worse as 7-zip.

The problem with cab file format it's that it's hard to use it in command line.

For example here is what you need to code to compress one directory into a cab file:
for %%i in (oggcodecs\*.*) do echo "%cd%\%%i" >> files.ddf
makecab /L . /D CompresionMemory=21 /D CompressionType=LZX /D DestinationDir=oggcodecs /F files.ddf
del files.ddf
move disk1\1.cab oggcodecs.cab
rmdir disk1
del setup.inf
del setup.rpt

Pretty hard core. One might say that this is not a tool to be used from a command line as rar or other popular archiving programs. This is done only once by me in a script file, so I can live with it.

The problem is with the extraction method. I have created a folder inside that cab file, which I can see with Total Commander, 7-zip File Manager etc, but with Windows Explorer I see directly the files, without the directory. There is one command line program which handles cab archives - expand.exe. Expand.exe doesn't know about directories in cab files, there is no switch to instruct him to preserve the directory structure from the cab file.

Why Microsoft? Why?

The solution is simple, create the destination folder first, d'oh!

mkdir oggcodecs
expand oggcodecs.cab -F:* oggcodecs\

Why not use 7-zip and ignore all this trouble? A cab file I can digitally sign and you can see it's coming from me and you don't need a 3rd party program to unpack!

2008-06-10

Why Microsoft? Why?!

I haven't mentioned here that I lost my fate in Microsoft that they can deliver good development tools a long time ago, I guess that was when I saw Visual Studio .NET 2002 for the first time. The .NET age fuc*ed it up real good.

At work I have Visual Studio 2003 and 2005 installed on D drive. Now I had to install Visual Studio 2008 on my system. I choose D drive, I verify every component that it should install on D drive and click Next, Next... Finish.

To my surprise the C++ component (VC directory) was installed on C drive, I said to myself... hmm, maybe I've forgot to install it on D, but it was working and I've ignored the issue.

The problem was when I've tried to compile something from the console. I've opened a console, setup the environment variables "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" and then hit nmake.

It complained that it could not find rc.exe, WTF. Then I found out that rc.exe is part of the Microsoft SDK which was on D (D:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\). When I try to setup the environment variables for Microsoft SDK ("d:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.Cmd" ) it complains that it can not find a compiler...

So now I'm installing everything on C drive, because for Microsoft, C++ should stay on C drive.

Edit: It works now (everything is on drive D), I've uninstalled all the programs that had a connection with Visual Studio 2008. If at first you don't succeed then try again, and again, and again.

2008-06-07

Authenticode

By using code signing with a certificate provided by Certum I was able to change how the oggcodecs installer looks on Windows Vista from this:



to this:



The name of the installer looks different, but my name is displayed under :)

Maintainer for Directshow Filters for Ogg Vorbis, Speex, Theora and FLAC

I probably should have blogged sooner, but here it is: I'm the current maintainer for Directshow Filters for Ogg Vorbis, Speex, Theora and FLAC.

If you want a hardware Ogg Player you should consider buying a Trekstor Samsung (most of their MP3 players support Ogg Vorbis and FLAC formats) product!