Archive for September, 2006

Vista update

Saturday, September 30th, 2006

Tyler from Microsoft has contacted me about my Vista bug report. He said he’ll open an internal bug report for it, but can’t promise it’d be fixed before RTM. In the mean time, newer versions of NSIS will include the manifest so no problems should come up with them.

Logical extensions

Friday, September 29th, 2006

While working on a new NSIS header file to properly handle Windows versions, I thought of something really cool. The LogicLib is a cool library dselkirk and eccles wrote a long time ago. It allows you to avoid using labels, Goto, StrCmp, IntCmp, relative jumps and other cool beans. Instead, you get a bunch of macros wrapped in defines that make your life so much easier.

${If} $0 == "good"
DetailPrint "it's not evil"
${EndIf}

It struck me while I was thinking of the interface I want to use for the new version checking stuff, I originally started with a function taking an argument. However, functions and header files don’t work too well together. A warning is spewed, if the function isn’t used. The code was also meant to be short, as there isn’t too much to do. So, combine those two together and of course you get macros. But what will the macro get? Labels to jump to? What if the user passes relative jumps? What if the user wants to skip a label definition and just jump to the next line? Why can’t it be like LogicLib? Because these checks don’t fit into LogicLib.nsh? So what? Why can’t I define more tests for LogicLib? Who said I can’t? I can.

And it turns out adding more tests to LogicLib is quite easy as well. Just define a macro with a name prefixed with an underscore and give it four parameters. Two operands and jump labels for true and false. The LogicLib will handle creating the labels and all that is left for this little macro is the actual test.

!macro _= _a _b _t _f
IntCmp `${_a}` `${_b}` `${_t}` `${_f}` `${_f}`
!macroend

The end result is quite cool. Instead of yet another new interface for another functionality, there are just a few new operators for LogicLib.

${If} ${AtLeastWin2000}
DetailPrint "2000 or better. Fun!"
${EndIf}

The new code is available on CVS for your eager browsing. Crave code. Craving is good.

The great outdoors

Sunday, September 24th, 2006

Beach timeStargate is off for “fall break”. Seasons of 4400, The Shield and House have all ended. Nothing to watch on TV anymore. Well, except for the news, but that show has been airing reruns for so long it’s a arguably laughable. Now and then they find something semi-new, like the latest Thai coup. But overall, it’s almost always the same episodes over and over again.

If already on the subject, does the completion of “Carter & McKay’s intergalactical bridge” mean SG-1 will finally see some digital stargates? And is it just me or 4400 is becoming more and more X-men’ish with each passing episode? Too bad for Kenny Johnson, I think he really liked the first episode…

Well, more time for rest & recreation or beer & beach I guess… Too bad summer is on the brink of destruction almost over.

Longer is better

Friday, September 22nd, 2006

The modern technological world is all about faster and smaller these days. New acronyms pop-up daily. It’d probably be an understatement saying an average technology related sentence contains at least 3 abbreviation of some kind, be it an acronym or just a simple abbreviation. It’s deeply embedded in us, there’s no running away from it. We are so used to it, we normally don’t even recognize an abbreviation when we see it. They are just normal words for us.

I really like exploiting this when I’m bored or when I’m writing long official documents, especially those I don’t want to write. Instead of talking or writing like every other human being on the planet, I expand every possible abbreviation to the longest form available. It drives people nuts. Not only do they need to read more, they need to think longer and reabbreviate the words. Some expansions, people don’t even recognize and have to come back for an explanation.

That’s the time abbreviations become a total absurd - when people don’t even know the original meaning. Then you get redundant definitions like YWMT (sounds better in Hebrew) which stands for yellow white marking tape. No one knows or cares the W in WMT stands for white. WMT is just a marking tape for everybody. So when in need of an abbreviation for a yellow marking tape, it’s just called yellow WMT or YWMT.

Cowardly new world

Saturday, September 16th, 2006

The new Windows Vista, filled with shiny new features, hyped on security, and runs dead slow and with no sound on Virtual PC. I should have installed it on a real computer, but that’s a different story. This post is all about Vista’s love towards NSIS. Vista loves NSIS so much, it mentions it in no less than kernel32.dll. Well, I might be reading too much into it. It also has Gentee, InstallShield, Raphael Install Builder (what’s that?), Astrum, Inno Setup and even WinRAR.

But why? Security, what else. Vista’s new UAC asks the user to enter an administrator’s password for administrative operations, such as installing an application. Back in the old days (last Monday), one had to use runas or logout and login as an administrator in order to install an application, assuming he was running a non-administrator account. As you probably know, that’s quite annoying. Users usually use an administrator account all the time and skip this annoyance. UAC allows creating standard users with no administrative privileges and still using them comfortably, even for administrative tasks. Just like sudo for Linux or that new lock icon on Mac OS X. This way, a standard user can be used and all sorts of harm can be avoided. Malicious code accidentally executed or intentionally injected using an unpatched vulnerability will not have access to the entire computer, but rather only the user’s space.

To make it easy on the transition, Microsoft has stuffed kernel32.dll with detection code for all sorts of installers, including NSIS. When it detects an installer is being executed, it’ll automatically jump into administrative execution level, not before asking for the administrator password. A similar thing is already done older versions of Windows where an option to run as administrator is automatically presented for applications that have setup in their name.

The execution level Windows will ask from the user can be controlled by the application manifest. I started digging into this when I was adding a new command to NSIS, RequestExecutionLevel, that specifies the execution level in the manifest. I was surprised to see that even without the manifest, it still requested an administrator password. Naturally, I got curious and embarked on reckon mission to find out the nature of this newly formed relationship between NSIS and Vista. I saw most of the stuff I’ve already read about in action and those new things I just mentioned above.

However, there is one thing I couldn’t find mentioned anywhere and for which I certainly couldn’t find any logical explanation. It identifies MakeNSISw.exe, zip2exe.exe and MakeLangId.exe as something that requires administrative execution level. It also identifies the uninstaller, but that makes sense because it’s actually an installer with different strings and pages. At first, I thought it identifies every application created by another application that requires administrative execution level. I also tried installing Inno Setup and got similar results where its compiler and uninstaller were identified. But it turns out I was wrong. If, for example, I created an installer that just extracts makensis.exe (no w, the command line compiler), it’s not identified. I also downloaded MakeNSISw.exe separately and it was still identified and marked with that little Windows shield icon. I was finally convinced this is some funky bug when I saw nsisconf.nsh also comes up with that little shield icon and that’s just a text file which is not even associated with MakeNSISw.exe. Then I realized NSH files take their icon from MakeNSISw.exe and that was indeed why it’s marked with the shield.

If something as harmless as MakeLangId.exe gets labeled, I wonder what else does… I hope they fix it until RC2. Not the nicest of features. Too much on the paranoiac side…

Update: seems like MakeLangId.exe and MakeNSISw.exe are labeled because they contain the phrase “Nullsoft.NSIS” in its manifest. I don’t see why they’d want to do that. That’s just a prefix we use. Installers are marked with “Nullsoft.NSIS.exehead”, there’s no need to catch the entire package. That’s definitely enough information for a bug report.

One million

Friday, September 15th, 2006

I just had a quick look at the statistics and noticed NSIS downloads on SourceForge surpassed 1,000,000. That’s one and a half terabyte of NSIS downloads. Add a couple million page views a month taking around 17GB of bandwidth and you’ll get quite some bandwidth. So, before I sit back, relax and step on cloud nine, I’d like to thank SourceForge for their hosting for the last 4 years. I don’t even want to think about having to handle that just as a side dish to the big-shot projects that have over one million downloads a day.

I’ll sit back now. See you in 1 more million downloads :D

It’s raining stuff

Friday, September 15th, 2006

Someone linked to this cool video on IRC. The first thing I thought of when I saw the first object fall into the glass is Magnolia. More specifically, that last scene where frogs fall from the sky. I think that was a good movie, I don’t actually remember… I guess I’d have to watch it again.

Then, when I tried to figure out what exactly it was that fell from the sky, I immediately thought of shotgun shells. I imagined it’d be an anti-war or gun proliferation movie because of the context. Mini Lord of War, if you wish. How pessimistic of me.

The end reminded me of the Good Idea / Bad Idea sketches from Animaniacs, which led me to a complete list of the sketches. That was a good show. Narf! :)

Anyway, here’s the video.

Watch video