今天看到 Taiwan C!Net 的一篇新聞: http://taiwan.cnet.com/news/software/0,2000064574,20088766,00.htm
想不到,微軟居然 release 專案到 http://sourceforge.net去,蠻破天荒的~~@_@
專案的名稱是 Windows Installer XML (WiX),而網址在: http://sourceforge.net/projects/wix/
是的,看專案名稱就知道這是一個有關 installer 的專案.
以下從原網站貼過來,並翻譯了一下.
The Windows Installer XML (WiX) is a toolset that builds Windows installation packages from XML source code. The toolset supports a command line environment that developers may integrate into their build processes to build MSI and MSM setup packages.
Windows Installer XML (WiX) 是一組用來從 XML 源碼裡建立 Windows 安裝套件的工具組.這個工具組提供了一個命令列的環境,讓使用者可以將製作 MSI 與 MSM 安裝套件的步驟整合到自己的開發程序裡面.
下載以後,稍稍的玩了一下,發現用法很簡單(難的是 .wxs 的內容,有點小複雜,目前也已經有人在 SourceForge 開了專案要來解決這個複雜的部分)~~
步驟大致是這樣的:先用 notepad 製作出一個 .wxs , 這個 .wxs 其實是一個特殊的 .xml,提供了所有 package 所需要的資訊.然後再使用 candle 這個指令將 .wxs 轉為 .wxiobj 中介檔.
你可以使用 notepad 去觀察 .wxiobj ,你會發現其實他也是一個 .xml 檔案,只是更讓人看不懂~~最後再使用 light 指令,就可以產生出 .msi (installer)或 .msm (installer module)檔案了.這裡也提供了另外一個有趣的工具叫 dark, 它是一個反向工程的工具,用來把 .msi 或 .msm 轉為 .wxs
仔細看一下上面提到的三個工具的名字: candle, light, dark 翻譯成中文正好就是蠟燭,點亮,吹滅. 很有趣不是嗎?! 🙂
WiX 專案發起人的 blog
Using the WiX Toolset to Integrate Setup into Your Development Process