[or-cvs] r18847: {torvm} Use wixtool to create Vidalia and Tor VM packages with arbit (in torvm/trunk/build/win32: . files patches src/pkg)

coderman at seul.org coderman at seul.org
Tue Mar 10 05:59:48 UTC 2009


Author: coderman
Date: 2009-03-10 01:59:48 -0400 (Tue, 10 Mar 2009)
New Revision: 18847

Modified:
   torvm/trunk/build/win32/Makefile
   torvm/trunk/build/win32/files/buildall.sh
   torvm/trunk/build/win32/patches/vidalia-torvm.patch
   torvm/trunk/build/win32/src/pkg/bundle.nsi
   torvm/trunk/build/win32/src/pkg/netinst.nsi
   torvm/trunk/build/win32/src/pkg/torvm.wxs
Log:
Use wixtool to create Vidalia and Tor VM packages with arbitrary directory tree content.

Modified: torvm/trunk/build/win32/Makefile
===================================================================
--- torvm/trunk/build/win32/Makefile	2009-03-10 04:48:59 UTC (rev 18846)
+++ torvm/trunk/build/win32/Makefile	2009-03-10 05:59:48 UTC (rev 18847)
@@ -217,20 +217,20 @@
 VIDALIA_TGZ=$(VIDALIA_NAME).tar.gz
 VIDALIA_SVN=https://svn.vidalia-project.net/svn/vidalia/
 VIDALIA_BR=trunk
-VIDALIA_VER=3601
+VIDALIA_VER=3604
 
 # for package resources
 TORSVN_NAME=tor-latest
 TORSVN_TGZ=$(TORSVN_NAME).tar.gz
 TORSVN_SVN=https://tor-svn.freehaven.net/svn/tor/
 TORSVN_BR=trunk
-TORSVN_VER=18791
+TORSVN_VER=18833
 
 TORBUTTON_NAME=torbutton-latest
 TORBUTTON_TGZ=$(TORBUTTON_NAME).tar.gz
 TORBUTTON_SVN=https://tor-svn.freehaven.net/svn/torbutton/
 TORBUTTON_BR=trunk
-TORBUTTON_VER=18788
+TORBUTTON_VER=18834
 
 # XXX add / switch to signed tags one key mgmt resolved
 PYCRYPTO_NAME=pycrypto-latest

Modified: torvm/trunk/build/win32/files/buildall.sh
===================================================================
--- torvm/trunk/build/win32/files/buildall.sh	2009-03-10 04:48:59 UTC (rev 18846)
+++ torvm/trunk/build/win32/files/buildall.sh	2009-03-10 05:59:48 UTC (rev 18847)
@@ -199,10 +199,12 @@
   else
     echo "BUILD_COMPLETE" >> build.log
   fi
+  # clean up terminal cntrl chars
+  cat build.log | sed 's/[[:cntrl:]]//g' | sed 's/\[[0-9]*m//g' | sed 's/\][0-9]*m//g' > build.log.txt
   if [[ "$BUILD_SCP_USER" != "" ]]; then
     echo "Transferring build to destination ${BUILD_SCP_HOST}:${bld_dsub} ..."
     scp -o BatchMode=yes -o CheckHostIP=no -o StrictHostKeyChecking=no \
-        build.log "${BUILD_SCP_USER}@${BUILD_SCP_HOST}:${bld_dsub}/win32build.log"
+        build.log.txt "${BUILD_SCP_USER}@${BUILD_SCP_HOST}:${bld_dsub}/win32build.log"
   fi
   if [[ "$AUTO_SHUTDOWN" == "TRUE" ]]; then
     echo "Invoking automated shutdown ..."
@@ -994,12 +996,13 @@
 TOR_WXS_DIR=contrib
 # Suppress logo and irrelevant warnings about ALLUSERS path variation
 LIGHT_OPTS="-nologo -sw1076"
+CANDLE_OPTS="-nologo"
 WIX_UI=/wix/WixUIExtension.dll
 WIXSRC_WXLDIR=/src/$WIXSRC_DIR/src/ext/UIExtension/wixlib
 DEF_WXL_LANG=en-us
 WXL_LANGS="cs-cz de-de es-es fr-fr hu-hu it-it ja-jp nl-nl pl-pl ru-ru uk-ua en-us"
 # XXX currently problems with WiX handling of: zh_CN zh_TW
-VIDALIA_LANGS="cs de es fa fi fr he it nl pl pt ro ru sv en"
+VIDALIA_LANGS="cs de es fa fi fr he it nl pl pt ro ru sv"
 WIX_ALL_LOC_LINK=""
 for LANG in $WXL_LANGS; do
   WIX_ALL_LOC_LINK="${WIX_ALL_LOC_LINK} -loc WixUI_${LANG}.wxl"
@@ -1007,7 +1010,7 @@
 for LANG in $VIDALIA_LANGS; do
   WIX_ALL_LOC_LINK="${WIX_ALL_LOC_LINK} -loc vidalia_${LANG}.wxl"
 done
-WIX_DEFAULT_LOC_LINK="-cultures:en-us -loc vidalia_en.wxl"
+WIX_DEFAULT_LOC_LINK="-loc WixUI_en-us.wxl -loc vidalia_en.wxl"
 
 # Building locale specific package variants results in aprox. 300MB of MSI packages.
 if [[ "$BUILD_IND_LANGS" == "" ]]; then
@@ -1020,7 +1023,7 @@
   cd /src
   tar zxf pkg.tgz
   if [ -f /usr/src/$VIDALIA_DIR/src/vidalia/vidalia.exe ]; then
-    echo "Creating Vidalia MSI package ..."
+    echo "Creating Vidalia MSI packages ..."
     cd /src/$VIDALIA_DIR
     for FILE in QtCore4.dll QtGui4.dll QtNetwork4.dll QtXml4.dll QtSvg4.dll; do
       cp /$sysdrive/Qt/$QT_VER/bin/$FILE bin/
@@ -1039,7 +1042,6 @@
       cp $MARBLE_DEST/plugins/*.dll plugins/
       cp $MARBLE_DEST/plugins/*.dll bin/
       cp /$sysdrive/Qt/$QT_VER/plugins/imageformats/*.dll plugins/imageformats/
-      cp /$sysdrive/Qt/$QT_VER/plugins/imageformats/*.dll bin/
     fi
     if [[ "$DEBUG_NO_STRIP" == "" ]]; then
       echo "Stripping debug symbols from binaries and libraries ..."
@@ -1052,33 +1054,99 @@
       strip plugins/imageformats/*.dll
     fi
 
-    # typical work flow using generated component fragments from heat.exe:
-    # heat.exe dir $pkgdir -gg -ke -sfrag -nologo -out "${pkgdir}.wxs" -template:product
-    # tail +4c $out > $tmp, dos2unix $tmp
-    # wixtool.exe splice -i prod.wxs -o out.wxs Directory:DirName=heat.wxs:Directory:dirname
-    # wixtool.exe splice -i out.wxs -o final.wxs Feature:MainApplication=heat.wxs:Feature:ProductFeature
-    # light.exe -sloc -out vid.wixout -xo -cc cabcache WixUI_Custom.wixobj vidalia.wixobj -ext /wix/WixUIExtension.dll
-    # light.exe "-cultures:es-es;de-de;en-us" -loc WixUI_es-es.wxl -loc WixUI_de-de.wxl -loc WixUI_en-us.wxl -loc vidalia_es.wxl -loc vidalia_de.wxl -loc vidalia_en.wxl -out test.msi -cc cabcache -reusecab vid.wixout
-
     cp pkg/win32/*.vbs ./
     cp pkg/win32/default-*.bmp ./
     cp $WIXSRC_WXLDIR/*.wxl ./
     cp pkg/win32/*.wxl ./
-    candle.exe pkg/win32/*.wxs
-    light.exe $LIGHT_OPTS -out vidalia.msi vidalia.wixobj WixUI_Custom.wixobj $WIX_DEFAULT_LOC_LINK -ext $WIX_UI
+    candle.exe $CANDLE_OPTS pkg/win32/*.wxs
+    cp src/tools/wixtool/wixtool.exe ./
+
+    # build the large marble variant first, subsequent pkgs trim from here.
+    if [ -d $MARBLE_DEST ]; then
+      echo "Creating full marble data Vidalia package ..."
+      cp -a $MARBLE_DEST/data ./
+      tar cf save-full-data.tar data/maps/earth/srtm data/landcolors.leg data/seacolors.leg data/maps/earth/bluemarble data/maps/earth/citylights data/mwdbii data/placemarks data/stars data/svg
+      rm -rf data
+      tar xf save-full-data.tar; rm save-full-data.tar
+      heat.exe dir data -gg -ke -sfrag -nologo -out fulldata-dir.wxs -template:product
+      if [ ! -f fulldata-dir.wxs ]; then
+        echo "Failed to generate directory tree component for full Marble data dir."
+      else
+        # whatever WiX is putting in those first four bytes causes parser havoc
+        tail +4c fulldata-dir.wxs > fulldata-dir.wxs.tmp; dos2unix fulldata-dir.wxs.tmp; cat fulldata-dir.wxs.tmp > fulldata-dir.wxs; rm -f fulldata-dir.wxs.tmp
+        wixtool.exe splice -i pkg/win32/vidalia.wxs -o fulldata-tmpdir.wxs Directory:LocalPluginsDataDir=fulldata-dir.wxs:Directory:data
+        wixtool.exe splice -i fulldata-tmpdir.wxs -o fulldata-tmpall.wxs Feature:MainApplication=fulldata-dir.wxs:Feature:ProductFeature
+        wixtool.exe userlocal -i fulldata-tmpall.wxs -o fulldata-all.wxs "Software/Vidalia:MainApplication"
+        rm -f fulldata-tmpdir.wxs fulldata-tmpall.wxs
+        candle.exe $CANDLE_OPTS fulldata-all.wxs
+        WIX_CAB_CACHE=_vid.cabcache
+        WIX_LINKOUT=_vid.wixout
+        if [ -e $WIX_CAB_CACHE ]; then
+          rm -rf $WIX_CAB_CACHE
+        fi 
+        if [ -e $WIX_LINKOUT ]; then
+          rm -rf $WIX_LINKOUT
+        fi
+        light.exe $LIGHT_OPTS -sloc -out $WIX_LINKOUT -xo -cc $WIX_CAB_CACHE WixUI_Custom.wixobj fulldata-all.wixobj -ext $WIX_UI
+        light.exe $LIGHT_OPTS -out vidalia-marble-full.msi -cc $WIX_CAB_CACHE $WIX_DEFAULT_LOC_LINK -reusecab $WIX_LINKOUT -ext $WIX_UI
+        if [ -f vidalia-marble-full.msi ]; then
+          cp vidalia-marble-full.msi $bundledir
+          cp vidalia-marble-full.msi ../pkg/
+          ls -l vidalia-marble-full.msi
+        else
+          echo "ERROR: unable to build vidalia full marble MSI installer."
+        fi
+      fi
+      echo "Creating reduced marble data Vidalia package ..."
+      tar cf save-min-data.tar data/landcolors.leg data/seacolors.leg data/maps/earth/bluemarble/bluemarble.dgml data/maps/earth/citylights/citylights.dgml data/maps/earth/srtm/srtm.dgml data/mwdbii data/placemarks/baseplacemarks.cache data/placemarks/boundaryplacemarks.cache data/placemarks/elevplacemarks.cache data/stars/stars.dat data/svg/worldmap.svg 
+      rm -rf data
+      tar xf save-min-data.tar; rm save-min-data.tar
+      heat.exe dir data -gg -ke -sfrag -nologo -out mindata-dir.wxs -template:product
+      if [ ! -f mindata-dir.wxs ]; then
+        echo "Failed to generate directory tree component for minimal Marble data dir."
+      else
+        tail +4c mindata-dir.wxs > mindata-dir.wxs.tmp; dos2unix mindata-dir.wxs.tmp; cat mindata-dir.wxs.tmp > mindata-dir.wxs; rm -f mindata-dir.wxs.tmp
+        wixtool.exe splice -i pkg/win32/vidalia.wxs -o mindata-tmpdir.wxs Directory:LocalPluginsDataDir=mindata-dir.wxs:Directory:data
+        wixtool.exe splice -i mindata-tmpdir.wxs -o mindata-tmpall.wxs Feature:MainApplication=mindata-dir.wxs:Feature:ProductFeature
+        wixtool.exe userlocal -i mindata-tmpall.wxs -o mindata-all.wxs "Software/Vidalia:MainApplication"
+        rm -f mindata-tmpdir.wxs mindata-tmpall.wxs
+        candle.exe $CANDLE_OPTS mindata-all.wxs
+        rm -rf $WIX_CAB_CACHE
+        rm -rf $WIX_LINKOUT
+        light.exe $LIGHT_OPTS -sloc -out $WIX_LINKOUT -xo -cc $WIX_CAB_CACHE WixUI_Custom.wixobj mindata-all.wixobj -ext $WIX_UI
+        light.exe $LIGHT_OPTS -out vidalia-marble.msi -cc $WIX_CAB_CACHE $WIX_DEFAULT_LOC_LINK -reusecab $WIX_LINKOUT -ext $WIX_UI
+        if [ -f vidalia-marble.msi ]; then
+          cp vidalia-marble.msi $bundledir
+          cp vidalia-marble.msi ../pkg/
+          ls -l vidalia-marble.msi
+        else
+          echo "ERROR: unable to build vidalia minimal marble MSI installer."
+        fi
+      fi
+    fi
+
+    echo "Linking minimal Vidalia package ..."
+    WIX_CAB_CACHE=_vid.cabcache
+    WIX_LINKOUT=_vid.wixout
+    if [ -e $WIX_CAB_CACHE ]; then
+      rm -rf $WIX_CAB_CACHE
+    fi
+    if [ -e $WIX_LINKOUT ]; then
+      rm -rf $WIX_LINKOUT
+    fi
+    candle.exe $CANDLE_OPTS -dNOMARBLE pkg/win32/vidalia.wxs
+    light.exe $LIGHT_OPTS -sloc -out $WIX_LINKOUT -xo -cc $WIX_CAB_CACHE WixUI_Custom.wixobj vidalia.wixobj -ext $WIX_UI
+    light.exe $LIGHT_OPTS -out vidalia.msi -cc $WIX_CAB_CACHE $WIX_DEFAULT_LOC_LINK -reusecab $WIX_LINKOUT -ext $WIX_UI
     if [ -f vidalia.msi ]; then
       cp vidalia.msi $bundledir
       cp vidalia.msi ../pkg/
+      cp vidalia.msi vidalia-intl.msi
       cp -a bin ../pkg/
       ls -l vidalia.msi
     else
       echo "ERROR: unable to build vidalia MSI installer."
     fi
-    # the null LCID/codepage should actually be run through ascii filter to be sure.
-    cp WixUI_en-us.wxl WixUI_nullcp.wxl
-    cp vidalia_en.wxl vidalia_nullcp.wxl
-    cp WixUI_nullcp.wxl vidalia_nullcp.wxl ../pkg/
-    light.exe $LIGHT_OPTS -out vidalia-intl.msi vidalia.wixobj WixUI_Custom.wixobj -loc WixUI_nullcp.wxl -loc vidalia_nullcp.wxl -ext $WIX_UI
+    export BASEMSI=""
     if [ -f vidalia-intl.msi ]; then
       export BASEMSI=vidalia-intl.msi
     fi
@@ -1093,14 +1161,14 @@
         done
         outfile="vidalia-${LANG}.msi"
         echo "Linking localized $outfile ..."
-        light.exe $LIGHT_OPTS -out $outfile vidalia.wixobj WixUI_Custom.wixobj -cultures:$WIXCULTURE -loc "vidalia_${LANG}.wxl" -ext $WIX_UI
+        light.exe $LIGHT_OPTS -out $outfile -cc $WIX_CAB_CACHE -cultures:$WIXCULTURE -loc "vidalia_${LANG}.wxl" -reusecab $WIX_LINKOUT -ext $WIX_UI
         if [ -f $outfile ]; then
           cp $outfile $bundledir
           cp $outfile ../pkg/
           ls -l $outfile
           if [ -f $BASEMSI ]; then
             echo "Adding language $LANG as transform against minimal MSI package ..."
-            cscript.exe mktransform.vbs "$LANG" "$BASEMSI" "$outfile"
+            cscript.exe //Nologo mktransform.vbs "$LANG" "$BASEMSI" "$outfile"
           fi
         else
           echo "ERROR: unable to link localized $outfile vidalia MSI installer."
@@ -1132,7 +1200,7 @@
   done
   cp -a $ddir ./
   # XXX replace this with Matt's torbutton NSIS magic
-  candle.exe *.wxs
+  candle.exe $CANDLE_OPTS *.wxs
 
   echo "Building Tor Vidalia bundle license docs package ..."
   cp -a $licensedir ./LicenseDocs
@@ -1144,9 +1212,10 @@
     # whatever WiX is putting in those first four bytes causes parser havoc
     tail +4c license-dir.wxs > license-dir.wxs.tmp; dos2unix license-dir.wxs.tmp; cat license-dir.wxs.tmp > license-dir.wxs; rm -f license-dir.wxs.tmp
     wixtool.exe splice -i license.wxs -o license-tmpdir.wxs Directory:ProgramsInstDir=license-dir.wxs:Directory:LicenseDocs
-    wixtool.exe splice -i license-tmpdir.wxs -o license-all.wxs Feature:MainApplication=license-dir.wxs:Feature:ProductFeature
-    rm -f license-tmpdir.wxs
-    candle.exe license-all.wxs
+    wixtool.exe splice -i license-tmpdir.wxs -o license-tmpall.wxs Feature:MainApplication=license-dir.wxs:Feature:ProductFeature
+    wixtool.exe userlocal -i license-tmpall.wxs -o license-all.wxs "Software/Tor Vidalia License Docs:MainApplication"
+    rm -f license-tmpdir.wxs license-tmpall.wxs
+    candle.exe $CANDLE_OPTS license-all.wxs
     echo "Linking Tor Vidalia bundle license docs package ..."
     light.exe $LIGHT_OPTS -out license.msi WixUI_Custom.wixobj license-all.wixobj $WIX_DEFAULT_LOC_LINK -ext $WIX_UI
     if [ -f license.msi ]; then
@@ -1158,20 +1227,46 @@
   fi
 
   echo "Linking torvm MSI installer package ..."
-  light.exe $LIGHT_OPTS -out torvm.msi WixUI_Custom.wixobj torvm.wixobj $WIX_DEFAULT_LOC_LINK -ext $WIX_UI
+  mv bin save-bin
+  mv Tor_VM/bin ./
+  mv Tor_VM/lib ./
+  mv Tor_VM/state ./
+  mv Tor_VM/torvm.exe ./
+  heat.exe dir bin -gg -ke -sfrag -nologo -out torvm-bin.wxs -template:product
+  heat.exe dir lib -gg -ke -sfrag -nologo -out torvm-lib.wxs -template:product
+  heat.exe dir state -gg -ke -sfrag -nologo -out torvm-state.wxs -template:product
+  tail +4c torvm-bin.wxs > torvm-bin.wxs.tmp; dos2unix torvm-bin.wxs.tmp; cat torvm-bin.wxs.tmp > torvm-bin.wxs; rm -f torvm-bin.wxs.tmp
+  tail +4c torvm-lib.wxs > torvm-lib.wxs.tmp; dos2unix torvm-lib.wxs.tmp; cat torvm-lib.wxs.tmp > torvm-lib.wxs; rm -f torvm-lib.wxs.tmp
+  tail +4c torvm-state.wxs > torvm-state.wxs.tmp; dos2unix torvm-state.wxs.tmp; cat torvm-state.wxs.tmp > torvm-state.wxs; rm -f torvm-state.wxs.tmp
+  wixtool.exe splice -i torvm.wxs -o torvm-tmpdir.wxs Directory:ProgramsInstDir=torvm-bin.wxs:Directory:bin
+  wixtool.exe splice -i torvm-tmpdir.wxs -o torvm-tmpall.wxs Feature:MainApplication=torvm-bin.wxs:Feature:ProductFeature
+  wixtool.exe splice -i torvm-tmpall.wxs -o torvm-tmpdir.wxs Directory:ProgramsInstDir=torvm-lib.wxs:Directory:lib
+  wixtool.exe splice -i torvm-tmpdir.wxs -o torvm-tmpall.wxs Feature:MainApplication=torvm-lib.wxs:Feature:ProductFeature
+  wixtool.exe splice -i torvm-tmpall.wxs -o torvm-tmpdir.wxs Directory:ProgramsInstDir=torvm-state.wxs:Directory:state
+  wixtool.exe splice -i torvm-tmpdir.wxs -o torvm-tmpall.wxs Feature:MainApplication=torvm-state.wxs:Feature:ProductFeature
+  wixtool.exe userlocal -i torvm-tmpall.wxs -o torvm-all.wxs "Software/Tor VM:MainApplication"
+  rm -f torvm-tmpdir.wxs torvm-tmpall.wxs
+  candle.exe $CANDLE_OPTS torvm-all.wxs
+  WIX_CAB_CACHE=_torvm.cabcache
+  WIX_LINKOUT=_torvm.wixout
+  if [ -e $WIX_CAB_CACHE ]; then
+    rm -rf $WIX_CAB_CACHE
+  fi
+  if [ -e $WIX_LINKOUT ]; then
+    rm -rf $WIX_LINKOUT
+  fi
+  light.exe $LIGHT_OPTS -sloc -out $WIX_LINKOUT -xo -cc $WIX_CAB_CACHE WixUI_Custom.wixobj torvm-all.wixobj -ext $WIX_UI
+  light.exe $LIGHT_OPTS -out torvm.msi -cc $WIX_CAB_CACHE $WIX_DEFAULT_LOC_LINK -reusecab $WIX_LINKOUT -ext $WIX_UI
   if [ -f torvm.msi ]; then
     cp torvm.msi $bundledir
+    cp torvm.msi torvm-intl.msi
     ls -l torvm.msi
   else
     echo "ERROR: unable to build Tor VM MSI installer."
   fi
-  echo "Linking minimal zero codepage MSI installer package ..."
-  light.exe $LIGHT_OPTS -out torvm-intl.msi WixUI_Custom.wixobj torvm.wixobj -loc WixUI_nullcp.wxl -loc vidalia_nullcp.wxl -ext $WIX_UI
+  export BASEMSI=""
   if [ -f torvm-intl.msi ]; then
     export BASEMSI=torvm-intl.msi
-  else
-    echo "ERROR: unable to link minimal zero codepage Tor VM MSI installer."
-    export BASEMSI=""
   fi
   if [[ "$BUILD_IND_LANGS" == "yes" ]]; then
     for LANG in $VIDALIA_LANGS; do
@@ -1184,13 +1279,13 @@
       done 
       outfile="torvm-${LANG}.msi"
       echo "Linking localized $outfile ..."
-      light.exe $LIGHT_OPTS -out $outfile torvm.wixobj WixUI_Custom.wixobj -cultures:$WIXCULTURE -loc "vidalia_${LANG}.wxl" -ext $WIX_UI
+      light.exe $LIGHT_OPTS -out $outfile -cc $WIX_CAB_CACHE -cultures:$WIXCULTURE -loc "vidalia_${LANG}.wxl" -reusecab $WIX_LINKOUT -ext $WIX_UI
       if [ -f $outfile ]; then
         cp $outfile $bundledir
         ls -l $outfile
         if [ -f "$BASEMSI" ]; then
           echo "Adding language $LANG as transform against minimal MSI package ..."
-          cscript.exe mktransform.vbs "$LANG" "$BASEMSI" "$outfile"
+          cscript.exe //Nologo mktransform.vbs "$LANG" "$BASEMSI" "$outfile"
         fi
       else
         echo "ERROR: unable to link localized $outfile MSI installer."
@@ -1200,22 +1295,30 @@
   if [ -f "$BASEMSI" ]; then
     cp "$BASEMSI" $bundledir
   fi
+  mv bin lib state torvm.exe Tor_VM/
+  mv save-bin bin
 
   echo "Linking tor MSI installer package ..."
-  light.exe $LIGHT_OPTS -out tor.msi WixUI_Custom.wixobj tor.wixobj $WIX_DEFAULT_LOC_LINK -ext $WIX_UI
+  WIX_CAB_CACHE=_tor.cabcache
+  WIX_LINKOUT=_tor.wixout
+  if [ -e $WIX_CAB_CACHE ]; then
+    rm -rf $WIX_CAB_CACHE
+  fi
+  if [ -e $WIX_LINKOUT ]; then
+    rm -rf $WIX_LINKOUT
+  fi
+  light.exe $LIGHT_OPTS -sloc -out $WIX_LINKOUT -xo -cc $WIX_CAB_CACHE WixUI_Custom.wixobj tor.wixobj -ext $WIX_UI
+  light.exe $LIGHT_OPTS -out tor.msi -cc $WIX_CAB_CACHE $WIX_DEFAULT_LOC_LINK -reusecab $WIX_LINKOUT -ext $WIX_UI
   if [ -f tor.msi ]; then
     cp tor.msi $bundledir
+    cp tor.msi tor-intl.msi
     ls -l tor.msi
   else
     echo "ERROR: unable to build Tor MSI installer."
   fi
-  echo "Linking minimal zero codepage MSI installer package ..."
-  light.exe $LIGHT_OPTS -out tor-intl.msi WixUI_Custom.wixobj tor.wixobj -loc WixUI_nullcp.wxl -loc vidalia_nullcp.wxl -ext $WIX_UI
+  export BASEMSI=""
   if [ -f tor-intl.msi ]; then
     export BASEMSI=tor-intl.msi
-  else
-    echo "ERROR: unable to link minimal zero codepage Tor VM MSI installer."
-    export BASEMSI=""
   fi
   if [[ "$BUILD_IND_LANGS" == "yes" ]]; then
     for LANG in $VIDALIA_LANGS; do
@@ -1228,13 +1331,13 @@
       done 
       outfile="tor-${LANG}.msi"
       echo "Linking localized $outfile ..."
-      light.exe $LIGHT_OPTS -out $outfile tor.wixobj WixUI_Custom.wixobj -cultures:$WIXCULTURE -loc "vidalia_${LANG}.wxl" -ext $WIX_UI
+      light.exe $LIGHT_OPTS -out $outfile -cc $WIX_CAB_CACHE -cultures:$WIXCULTURE -loc "vidalia_${LANG}.wxl" -reusecab $WIX_LINKOUT -ext $WIX_UI
       if [ -f $outfile ]; then
         cp $outfile $bundledir
         ls -l $outfile
         if [ -f "$BASEMSI" ]; then
           echo "Adding language $LANG as transform against minimal MSI package ..."
-          cscript.exe mktransform.vbs "$LANG" "$BASEMSI" "$outfile"
+          cscript.exe //Nologo mktransform.vbs "$LANG" "$BASEMSI" "$outfile"
         fi
       else
         echo "ERROR: unable to link localized $outfile MSI installer."
@@ -1246,20 +1349,26 @@
   fi
 
   echo "Linking polipo MSI installer package ..."
-  light.exe $LIGHT_OPTS -out polipo.msi WixUI_Custom.wixobj polipo.wixobj $WIX_DEFAULT_LOC_LINK -ext $WIX_UI
+  WIX_CAB_CACHE=_polipo.cabcache
+  WIX_LINKOUT=_polipo.wixout
+  if [ -e $WIX_CAB_CACHE ]; then
+    rm -rf $WIX_CAB_CACHE
+  fi
+  if [ -e $WIX_LINKOUT ]; then
+    rm -rf $WIX_LINKOUT
+  fi
+  light.exe $LIGHT_OPTS -sloc -out $WIX_LINKOUT -xo -cc $WIX_CAB_CACHE WixUI_Custom.wixobj polipo.wixobj -ext $WIX_UI
+  light.exe $LIGHT_OPTS -out polipo.msi -cc $WIX_CAB_CACHE $WIX_DEFAULT_LOC_LINK -reusecab $WIX_LINKOUT -ext $WIX_UI
   if [ -f polipo.msi ]; then
     cp polipo.msi $bundledir
+    cp polipo.msi polipo-intl.msi
     ls -l polipo.msi
   else
     echo "ERROR: unable to build polipo MSI installer."
   fi
-  echo "Linking minimal zero codepage MSI installer package ..."
-  light.exe $LIGHT_OPTS -out polipo-intl.msi WixUI_Custom.wixobj polipo.wixobj -loc WixUI_nullcp.wxl -loc vidalia_nullcp.wxl -ext $WIX_UI
+  export BASEMSI=""
   if [ -f polipo-intl.msi ]; then
     export BASEMSI=polipo-intl.msi
-  else
-    echo "ERROR: unable to link minimal zero codepage Polipo MSI installer."
-    export BASEMSI=""
   fi
   if [[ "$BUILD_IND_LANGS" == "yes" ]]; then
     for LANG in $VIDALIA_LANGS; do
@@ -1272,13 +1381,13 @@
       done 
       outfile="polipo-${LANG}.msi"
       echo "Linking localized $outfile ..."
-      light.exe $LIGHT_OPTS -out $outfile polipo.wixobj WixUI_Custom.wixobj -cultures:$WIXCULTURE -loc "vidalia_${LANG}.wxl" -ext $WIX_UI
+      light.exe $LIGHT_OPTS -out $outfile -cc $WIX_CAB_CACHE -cultures:$WIXCULTURE -loc "vidalia_${LANG}.wxl" -reusecab $WIX_LINKOUT -ext $WIX_UI
       if [ -f $outfile ]; then
         cp $outfile $bundledir
         ls -l $outfile
         if [ -f "$BASEMSI" ]; then
           echo "Adding language $LANG as transform against minimal MSI package ..."
-          cscript.exe mktransform.vbs "$LANG" "$BASEMSI" "$outfile"
+          cscript.exe //Nologo mktransform.vbs "$LANG" "$BASEMSI" "$outfile"
         fi
       else
         echo "ERROR: unable to link localized $outfile MSI installer."
@@ -1292,20 +1401,26 @@
   if [ -f /src/$TORBUTTON_FILE ]; then
     cp /src/$TORBUTTON_FILE torbutton.xpi
     echo "Linking torbutton MSI installer package ..."
-    light.exe $LIGHT_OPTS -out torbutton.msi WixUI_Custom.wixobj torbutton.wixobj $WIX_DEFAULT_LOC_LINK -ext $WIX_UI
+    WIX_CAB_CACHE=_torbutton.cabcache
+    WIX_LINKOUT=_torbutton.wixout
+    if [ -e $WIX_CAB_CACHE ]; then
+      rm -rf $WIX_CAB_CACHE
+    fi
+    if [ -e $WIX_LINKOUT ]; then
+      rm -rf $WIX_LINKOUT
+    fi
+    light.exe $LIGHT_OPTS -sloc -out $WIX_LINKOUT -xo -cc $WIX_CAB_CACHE WixUI_Custom.wixobj torbutton.wixobj -ext $WIX_UI
+    light.exe $LIGHT_OPTS -out torbutton.msi -cc $WIX_CAB_CACHE $WIX_DEFAULT_LOC_LINK -reusecab $WIX_LINKOUT -ext $WIX_UI
     if [ -f torbutton.msi ]; then
       cp torbutton.msi $bundledir
+      cp torbutton.msi torbutton-intl.msi
       ls -l torbutton.msi
     else
       echo "ERROR: unable to build torbutton MSI installer."
     fi
-    echo "Linking minimal zero codepage MSI installer package ..."
-    light.exe $LIGHT_OPTS -out torbutton-intl.msi WixUI_Custom.wixobj torbutton.wixobj -loc WixUI_nullcp.wxl -loc vidalia_nullcp.wxl  -ext $WIX_UI
+    export BASEMSI=""
     if [ -f torbutton-intl.msi ]; then
       export BASEMSI=torbutton-intl.msi
-    else
-      echo "ERROR: unable to link minimal zero codepage TorButton MSI installer."
-      export BASEMSI=""
     fi
     if [[ "$BUILD_IND_LANGS" == "yes" ]]; then
       for LANG in $VIDALIA_LANGS; do
@@ -1318,13 +1433,13 @@
         done
         outfile="torbutton-${LANG}.msi"
         echo "Linking localized $outfile ..."
-        light.exe $LIGHT_OPTS -out $outfile torbutton.wixobj WixUI_Custom.wixobj -cultures:$WIXCULTURE -loc "vidalia_${LANG}.wxl" -ext $WIX_UI
+        light.exe $LIGHT_OPTS -out $outfile -cc $WIX_CAB_CACHE -cultures:$WIXCULTURE -loc "vidalia_${LANG}.wxl" -reusecab $WIX_LINKOUT -ext $WIX_UI
         if [ -f $outfile ]; then
           cp $outfile $bundledir
           ls -l $outfile
           if [ -f "$BASEMSI" ]; then
             echo "Adding language $LANG as transform against minimal MSI package ..."
-            cscript.exe mktransform.vbs "$LANG" "$BASEMSI" "$outfile"
+            cscript.exe //Nologo mktransform.vbs "$LANG" "$BASEMSI" "$outfile"
           fi
         else
           echo "ERROR: unable to link localized $outfile MSI installer."
@@ -1337,20 +1452,26 @@
   fi
 
   echo "Linking thandy MSI installer package ..."
-  light.exe $LIGHT_OPTS -out thandy.msi WixUI_Custom.wixobj thandy.wixobj $WIX_DEFAULT_LOC_LINK -ext $WIX_UI
+  WIX_CAB_CACHE=_thandy.cabcache
+  WIX_LINKOUT=_thandy.wixout
+  if [ -e $WIX_CAB_CACHE ]; then
+    rm -rf $WIX_CAB_CACHE
+  fi
+  if [ -e $WIX_LINKOUT ]; then
+    rm -rf $WIX_LINKOUT
+  fi
+  light.exe $LIGHT_OPTS -sloc -out $WIX_LINKOUT -xo -cc $WIX_CAB_CACHE WixUI_Custom.wixobj thandy.wixobj -ext $WIX_UI
+  light.exe $LIGHT_OPTS -out thandy.msi -cc $WIX_CAB_CACHE $WIX_DEFAULT_LOC_LINK -reusecab $WIX_LINKOUT -ext $WIX_UI
   if [ -f thandy.msi ]; then
     cp thandy.msi $bundledir
+    cp thandy.msi thandy-intl.msi
     ls -l thandy.msi
   else
     echo "ERROR: unable to build Thandy MSI installer."
   fi
-  echo "Linking minimal zero codepage MSI installer package ..."
-  light.exe $LIGHT_OPTS -out thandy-intl.msi WixUI_Custom.wixobj thandy.wixobj -loc WixUI_nullcp.wxl -loc vidalia_nullcp.wxl -ext $WIX_UI
+  export BASEMSI=""
   if [ -f thandy-intl.msi ]; then
     export BASEMSI=thandy-intl.msi
-  else
-    echo "ERROR: unable to link minimal zero codepage Thandy MSI installer."
-    export BASEMSI=""
   fi
   if [[ "$BUILD_IND_LANGS" == "yes" ]]; then
     for LANG in $VIDALIA_LANGS; do
@@ -1363,13 +1484,13 @@
       done
       outfile="thandy-${LANG}.msi"
       echo "Linking localized $outfile ..."
-      light.exe $LIGHT_OPTS -out $outfile thandy.wixobj WixUI_Custom.wixobj -cultures:$WIXCULTURE -loc "vidalia_${LANG}.wxl" -ext $WIX_UI
+      light.exe $LIGHT_OPTS -out $outfile -cc $WIX_CAB_CACHE -cultures:$WIXCULTURE -loc "vidalia_${LANG}.wxl" -reusecab $WIX_LINKOUT -ext $WIX_UI
       if [ -f $outfile ]; then
         cp $outfile $bundledir
         ls -l $outfile
         if [ -f "$BASEMSI" ]; then
           echo "Adding language $LANG as transform against minimal MSI package ..."
-          cscript.exe mktransform.vbs "$LANG" "$BASEMSI" "$outfile"
+          cscript.exe //Nologo mktransform.vbs "$LANG" "$BASEMSI" "$outfile"
         fi
       else
         echo "ERROR: unable to link localized $outfile MSI installer."

Modified: torvm/trunk/build/win32/patches/vidalia-torvm.patch
===================================================================
--- torvm/trunk/build/win32/patches/vidalia-torvm.patch	2009-03-10 04:48:59 UTC (rev 18846)
+++ torvm/trunk/build/win32/patches/vidalia-torvm.patch	2009-03-10 05:59:48 UTC (rev 18847)
@@ -31,8 +31,8 @@
  ### HTTP
 diff -Naur a/pkg/win32/vidalia.wxs.in b/pkg/win32/vidalia.wxs.in
 --- a/pkg/win32/vidalia.wxs.in	2009-02-24 05:46:46.615879000 +0000
-+++ b/pkg/win32/vidalia.wxs.in	2009-03-07 03:57:41.691104680 +0000
-@@ -1,260 +1,275 @@
++++ b/pkg/win32/vidalia.wxs.in	2009-03-09 16:26:33.282871496 +0000
+@@ -1,334 +1,369 @@
  <?xml version="1.0" encoding="Windows-1252" ?>
  <!-- 
 -  $Id: vidalia.wxs.in 3586 2009-02-24 05:46:46Z edmanm $
@@ -99,21 +99,22 @@
 -  <?define MarbleSvgDataGuid="03E25BCA-4C58-4571-9F17-061D52877714" ?>
 -
 -  <Product Name="Vidalia @VERSION@" Id="$(var.VidaliaProductGuid)"
+-           Language="1033" Codepage="1252"
+-           Version="$(var.VidaliaVersion)" 
 +  <Product Name="Vidalia $(var.ThisProductVersionDisp)" Id="$(var.CurrProductGUID)"
-            Language="1033" Codepage="1252"
--           Version="$(var.VidaliaVersion)" 
 +           Version="$(var.ThisProductVersion)"
             Manufacturer="vidalia-project.net"
 -           UpgradeCode="$(var.VidaliaUpgradeCode)">
++           Language="!(loc.LCID)"
 +           UpgradeCode="$(var.UpgradeCode)">
      
      <Package Id="*" Keywords="Installer"
 -             Description="Vidalia @VERSION@ Installer"
 +             Description="Vidalia $(var.ThisProductVersionDisp) Installer"
               Manufacturer="vidalia-project.net"
-              InstallerVersion="100" Compressed="yes"
+-             InstallerVersion="100" Compressed="yes"
 -             Languages="1033"  SummaryCodepage="1252" />
-+             Languages="1033"  SummaryCodepage="1252"
++             InstallerVersion="200" Compressed="yes"
 +             InstallPrivileges="limited" />
 +
 +    <!-- Properties used for variable replacement in translations. -->
@@ -225,8 +226,10 @@
 +            </RegistryKey>
 +            <File Id="VidaliaExe" DiskId="1"
 +                  Name="vidalia.exe" Source="bin\vidalia-2d.exe" />
++<?ifndef NOMARBLE ?>
 +            <File Id="VidaliaMarbleExe" DiskId="1"
 +                  Name="vidalia-marble.exe" Source="bin\vidalia-marble.exe" />
++<?endif?>
 +          </Component>
  
 -      <!-- Vidalia-related documents -->
@@ -263,8 +266,10 @@
 +                  Name="QtXml4.dll" Source="bin\QtXml4.dll" />
 +            <File Id="QtSvg4Dll" DiskId="1"
 +                  Name="QtSvg4.dll" Source="bin\QtSvg4.dll" />
++<?ifndef NOMARBLE ?>
 +            <File Id="MarbleQtWidgetDll" DiskId="1"
 +              Name="libmarblewidget.dll" Source="bin/libmarblewidget.dll" />
++<?endif ?>
 +          </Component>
  
 -      <!-- Qt-related library files -->
@@ -465,6 +470,7 @@
 +              DiskId="1"
 +            /> 
 +          </Component>
++<?ifndef NOMARBLE ?>
 +          <Directory Id="LocalPluginsDir" Name="plugins">
 +            <!-- Marble plugin library file -->
 +            <Component Id="MarblePlugin" Guid="$(var.CurrMarblePluginGUID)">
@@ -506,9 +512,12 @@
 +                </RegistryKey>
 +                <File Id="qsvg4.dll" DiskId="1"
 +                  Name="qsvg4.dll" Source="plugins/imageformats/qsvg4.dll" />
++                <File Id="qjpeg4.dll" DiskId="1"
++                  Name="qjpeg4.dll" Source="plugins/imageformats/qjpeg4.dll" />
 +              </Component>
 +            </Directory>
 +          </Directory>
++<?endif ?>
 +        </Directory>
 +      </Directory>
  
@@ -527,14 +536,16 @@
 -                      Directory="ShortcutFolder" WorkingDirectory="INSTALLDIR"
 +                      Name="Vidalia" Target="[LocalProgramsInstDir]vidalia.exe"
 +                      Directory="ShortcutFolder" WorkingDirectory="LocalProgramsInstDir"
-+                      Icon="vidalia.ico" IconIndex="0" />
+                       Icon="vidalia.ico" IconIndex="0" />
++<?ifndef NOMARBLE ?>
 +            <Shortcut Id="VidaliaMarbleStartMenuShortcut"
 +                      Name="Vidalia Marble" Target="[LocalProgramsInstDir]vidalia-marble.exe"
 +                      Directory="ShortcutFolder" WorkingDirectory="LocalProgramsInstDir"
-                       Icon="vidalia.ico" IconIndex="0" />
++                      Icon="vidalia.ico" IconIndex="0" />
++<?endif ?>
              <RemoveFolder Id="RemoveShortcutFolder" On="uninstall" />
            </Component>
-@@ -262,73 +277,80 @@
+         </Directory>
        </Directory>
  
        <Directory Id="DesktopFolder" Name="Desktop">
@@ -550,10 +561,12 @@
 +                    Name="Vidalia" Target="[LocalProgramsInstDir]vidalia.exe"
 +                    Directory="DesktopFolder" WorkingDirectory="LocalProgramsInstDir"
 +                    Icon="vidalia.ico" IconIndex="0" />
++<?ifndef NOMARBLE ?>
 +          <Shortcut Id="VidaliaMarbleDesktopShortcut"
 +                    Name="Vidalia Marble" Target="[LocalProgramsInstDir]vidalia-marble.exe"
 +                    Directory="DesktopFolder" WorkingDirectory="LocalProgramsInstDir"
                      Icon="vidalia.ico" IconIndex="0" />
++<?endif ?>
          </Component>
        </Directory>
  
@@ -591,9 +604,11 @@
 -        <ComponentGroupRef Id="MarbleData"/>
 +        <ComponentRef Id="GeoIPCache" />
 +        <ComponentRef Id="PolipoConfig" />
++<?ifndef NOMARBLE ?>
 +        <ComponentRef Id="MarblePlugin" />
 +        <ComponentRef Id="PluginDataDir" />
 +        <ComponentRef Id="PluginImageFormatsDir" />
++<?endif ?>
        </Feature>
        <Feature Id="Shortcuts" Title="Shortcuts"
                 AllowAdvertise="no" Absent="allow" Level="1"
@@ -788,8 +803,8 @@
 +
 diff -Naur a/src/tools/wixtool/wixtool.cpp b/src/tools/wixtool/wixtool.cpp
 --- a/src/tools/wixtool/wixtool.cpp	1970-01-01 00:00:00.000000000 +0000
-+++ b/src/tools/wixtool/wixtool.cpp	2009-03-07 15:46:41.482073464 +0000
-@@ -0,0 +1,467 @@
++++ b/src/tools/wixtool/wixtool.cpp	2009-03-10 02:55:48.337230000 +0000
+@@ -0,0 +1,673 @@
 +/*
 +**  $Id$
 +**
@@ -812,6 +827,25 @@
 +#define WIX_ATTR_ID  "Id"
 +#define WIX_ATTR_DIRACTION "uninstall"
 +#define WIX_ATTR_REGACTION "createAndRemoveOnUninstall"
++#define WIX_ATTR_VALUE "Value"
++#define WIX_ATTR_KEY "KeyPath"
++#define WIX_ATTR_GUID "Guid"
++#define WIX_ATTR_NAME "Name"
++#define WIX_ATTR_REG_TYPE "Type"
++#define WIX_ATTR_REG_NAME "Name"
++#define WIX_ATTR_REG_ROOT "Root"
++#define WIX_ATTR_REG_KEYPATH  "Key"
++#define WIX_ATTR_REG_ACTION  "Action"
++#define WIX_REG_KEY_TYPE "integer"
++#define WIX_TAG_FILE "File"
++#define WIX_TAG_DIR "Directory"
++#define WIX_TAG_FEATURE "Feature"
++#define WIX_TAG_COMPONENT "Component"
++#define WIX_TAG_COMPONENT_REF "ComponentRef"
++#define WIX_TAG_CREATEDIR "CreateFolder"
++#define WIX_TAG_REMOVEDIR "RemoveFolder"
++#define WIX_TAG_REGKEY "RegistryKey"
++#define WIX_TAG_REGVAL "RegistryValue"
 +
 +typedef void (*TraverseCallback)(void *cbdata, QDomElement e);
 +
@@ -838,6 +872,12 @@
 +  QString  newpropval;
 +} AddData;
 +
++typedef struct s_UserLocalData {
++  QString      keypath;
++  QString      featureid;
++  QStringList  newcomps;
++} UserLocalData;
++
 +bool
 +do_walkdoc(QDomNode  n,
 +  TraverseCallback  cb,
@@ -1131,12 +1171,167 @@
 +  return walkdoc(doc, &addfunc, &cbdata, errorMessage);
 +}
 +
++bool
++createRegLocalComponent(QDomElement e,
++ QString dirName,
++ QString keyPath)
++{ 
++  QDomElement nrk = e.ownerDocument().createElement(WIX_TAG_REGKEY);
++  QDomElement nrv = e.ownerDocument().createElement(WIX_TAG_REGVAL);
++  nrk.setAttribute(WIX_ATTR_REG_ROOT, "HKCU");
++  nrk.setAttribute(WIX_ATTR_REG_ACTION, "createAndRemoveOnUninstall");
++  nrk.setAttribute(WIX_ATTR_REG_KEYPATH, keyPath);
++  nrv.setAttribute(WIX_ATTR_REG_TYPE, WIX_REG_KEY_TYPE);
++  nrv.setAttribute(WIX_ATTR_REG_NAME, dirName);
++  nrv.setAttribute(WIX_ATTR_VALUE, "1");
++  nrv.setAttribute(WIX_ATTR_KEY, "yes");
++  nrk.appendChild(nrv);
++  e.appendChild(nrk);
++}
++
++bool
++createDirMgmtComponent(QDomElement e,
++ QString dirName)
++{
++  QDomElement nce = e.ownerDocument().createElement(WIX_TAG_CREATEDIR);
++  e.appendChild(nce);
++  nce = e.ownerDocument().createElement(WIX_TAG_REMOVEDIR);
++  nce.setAttribute("On", WIX_ATTR_DIRACTION);
++  nce.setAttribute(WIX_ATTR_ID, QString("Remove").append(dirName));
++  e.appendChild(nce);
++}
++
++void
++userlocalfunc(void *cbdata,
++ QDomElement e)
++{
++  UserLocalData *ulinfo = reinterpret_cast<UserLocalData *>(cbdata);
++  QString eid = e.attribute(WIX_ATTR_ID);
++
++  if (e.tagName().compare(WIX_TAG_FILE) == 0) {
++    e.removeAttribute(WIX_ATTR_KEY);
++  }
++  else if (e.tagName().compare(WIX_TAG_FEATURE) == 0) {
++    if (ulinfo->featureid.compare(e.attribute(WIX_ATTR_ID)) == 0) {
++      /* this is the target feature element for the new components, if any. */
++      QDomElement ne;
++      for (int i = 0; i < ulinfo->newcomps.count(); i++) {
++        QString currid = ulinfo->newcomps[i];
++        ne = e.ownerDocument().createElement(WIX_TAG_COMPONENT_REF);
++        ne.setAttribute(WIX_ATTR_ID, currid);
++        e.appendChild(ne);
++      }
++    }
++  }
++  else if (e.tagName().compare(WIX_TAG_DIR) == 0) {
++    QString dirName = e.attribute(WIX_ATTR_NAME);
++    QString dirId = e.attribute(WIX_ATTR_ID);
++    /* find all child components for this dir and see if it contains:
++     * create/remove folder elements, a registry element
++     */
++    if ( e.hasChildNodes() ) {
++      QDomElement fc;
++      bool  hasComponent = false;
++      bool  hasRegKey;
++      bool  hasDirMgmt = false;
++      QDomNodeList subnodes = e.childNodes();
++      for (int i = 0; i < subnodes.count(); i++) {
++        hasRegKey = false;
++        if (subnodes.item(i).isElement()) {
++          QDomElement ce = subnodes.item(i).toElement();
++          if (ce.tagName().compare(WIX_TAG_COMPONENT) == 0) {
++            if (!hasComponent) {
++              hasComponent = true;
++              fc = ce;
++            }
++            QDomNodeList compnodes = ce.childNodes();
++            for (int j = 0; j < compnodes.count(); j++) {
++              if (compnodes.item(j).isElement()) {
++                QDomElement compe = compnodes.item(j).toElement();
++                if (compe.tagName().compare(WIX_TAG_REGKEY) == 0) {
++                  hasRegKey = true;
++                }
++                else if (compe.tagName().compare(WIX_TAG_CREATEDIR) == 0) {
++                  hasDirMgmt = true;
++                }
++              }
++            }
++            if (!hasRegKey) {
++              createRegLocalComponent(ce, QString("RK").append(ce.attribute(WIX_ATTR_ID)), ulinfo->keypath);
++            }
++          }
++        }
++      }
++      if (hasComponent) {
++        /* If no registry based key path exists, create it under the
++         * first component for this directory element.
++         */
++        QString compname = fc.attribute(WIX_ATTR_ID);
++        if (!hasDirMgmt) {
++          createDirMgmtComponent(fc, compname);
++        }
++      }
++      else {
++        /* Certain system directories must be ignored; we don't manage them. */
++        if (dirId.compare("LocalAppDataFolder") &&
++            dirId.compare("AppDataFolder") &&
++            dirId.compare("CommonAppDataFolder") &&
++            dirId.compare("CommonFilesFolder") &&
++            dirId.compare("DesktopFolder") &&
++            dirId.compare("PersonalFolder") &&
++            dirId.compare("ProgramFilesFolder") &&
++            dirId.compare("ProgramMenuFolder") &&
++            dirId.compare("StartMenuFolder") &&
++            dirId.compare("StartupFolder") &&
++            dirId.compare("SystemFolder") &&
++            dirId.compare("TempFolder") &&
++            dirId.compare("WindowsFolder") ) {
++          /* if there is no component under this dir parent then we
++           * must create a component for the sole purpose of dir
++           * creation with the requisite registry key path.
++           */
++          QDomElement ne = e.ownerDocument().createElement(WIX_TAG_COMPONENT);
++          QString compId = QString("ULDirComp_").append(dirName);
++          ne.setAttribute(WIX_ATTR_GUID, "*");
++          ne.setAttribute(WIX_ATTR_ID, compId);
++          e.appendChild(ne);
++          createDirMgmtComponent(ne, dirName);
++          createRegLocalComponent(ne, QString("DRK").append(dirName), ulinfo->keypath);
++          ulinfo->newcomps.append(compId);
++        }
++      }
++    }
++  }
++}
++
++/** Make modifications to requested documents.
++ * returns false on error and <b>errorMessage</b> will be set.
++ */
++bool
++docuserlocal(QDomDocument *doc,
++  QString argument,
++  QString *errorMessage)
++{
++  Q_ASSERT(doc);
++  Q_ASSERT(errorMessage);
++  UserLocalData  cbdata;
++
++  QStringList ulinfo = argument.split(":");
++  if (ulinfo.count() < 2) {
++    *errorMessage = "Invalid argument for userlocal command: " + argument;
++    return false;
++  }
++  cbdata.keypath = ulinfo[0];
++  cbdata.featureid = ulinfo[1];
++  return walkdoc(doc, &userlocalfunc, &cbdata, errorMessage);
++}
++
 +/** Display application usage and exit. */
 +void
 +print_usage_and_exit()
 +{
 +  QTextStream error(stderr);
-+  error << "usage: wixtool <command> [-q] -i <infile> -o <outfile> <Arg0> ... <ArgN>" << endl;
++  error << "usage: wixtool <command> [-q] -i <infile> -o <outfile> <Arg0> [... <ArgN>]" << endl;
 +  error << "  command one of: " << endl;
 +  error << "    splice        Splice children from one document into another." << endl;
 +  error << "    replace       Replace elements or attributes in a document." << endl;
@@ -1156,7 +1351,7 @@
 +  error << "    Add properties or child elements to target" << endl;
 +  error << "    If newtagname is empty only properties added to dest" << endl;
 +  error << endl;
-+  error << "  userlocal args: [tagname][:Id]" << endl;
++  error << "  userlocal arg:  <registry key path>:<dest feature id>" << endl;
 +  error << "    Convert KeyPath File elements into the per user local idiom" << endl;
 +  error << "    with corresponding Create/RemoveDir and RegistryKey elements." << endl;
 +  error << endl;
@@ -1186,7 +1381,8 @@
 +  command = argv[1];
 +  if ( command.compare("splice", Qt::CaseInsensitive) &&
 +       command.compare("replace", Qt::CaseInsensitive) &&
-+       command.compare("add", Qt::CaseInsensitive) ) {
++       command.compare("add", Qt::CaseInsensitive) &&
++       command.compare("userlocal", Qt::CaseInsensitive) ) {
 +    print_usage_and_exit();
 +  }
 +
@@ -1217,6 +1413,14 @@
 +    return 2;
 +  }
 +
++  /* Make sure the outfile does not exist before we use it. */
++  if (QFile::exists(outfile)) {
++    if (!QFile::remove(outfile)) {
++      error << QString("Unable to truncate outfile '%1'\n").arg(outfile);
++      return 2;
++    }
++  }
++
 +  QDomDocument doc;
 +  QString parseError;
 +  int  badline, badcol;
@@ -1226,20 +1430,37 @@
 +    return 3;
 +  }
 +
-+  for (int i = 0; i < commandargs.count(); i++) {
-+    if (!command.compare("splice", Qt::CaseInsensitive)) {
-+      if (!docsplice(&doc, commandargs[i], &errorMessage)) {
-+        error << QString("Unable to process splice command '%1': %2\n")
-+                        .arg(commandargs[i]).arg(errorMessage);
-+        return 4;
++  if (!command.compare("userlocal", Qt::CaseInsensitive)) {
++    if (!docuserlocal(&doc, commandargs[0], &errorMessage)) {
++      error << QString("Unable to convert document components to user local: %1\n")
++                          .arg(errorMessage);
++      return 4;
++    }
++  }
++  else {
++    for (int i = 0; i < commandargs.count(); i++) {
++      if (!command.compare("splice", Qt::CaseInsensitive)) {
++        if (!docsplice(&doc, commandargs[i], &errorMessage)) {
++          error << QString("Unable to process splice command '%1': %2\n")
++                          .arg(commandargs[i]).arg(errorMessage);
++          return 4;
++        }
 +      }
++      else if (!command.compare("replace", Qt::CaseInsensitive)) {
++        if (!docreplace(&doc, commandargs[i], &errorMessage)) {
++          error << QString("Unable to process replace command '%1': %2\n")
++                          .arg(commandargs[i]).arg(errorMessage);
++          return 4;
++        }
++      }
++      else if (!command.compare("add", Qt::CaseInsensitive)) {
++        if (!docadd(&doc, commandargs[i], &errorMessage)) { 
++          error << QString("Unable to process add command '%1': %2\n")
++                          .arg(commandargs[i]).arg(errorMessage);
++          return 4;
++        }
++      }
 +    }
-+    else if (!command.compare("replace", Qt::CaseInsensitive)) {
-+        return 4;
-+    }
-+    else if (!command.compare("add", Qt::CaseInsensitive)) {
-+        return 4;
-+    }
 +  }
 +
 +  /* Open the output file for writing. */

Modified: torvm/trunk/build/win32/src/pkg/bundle.nsi
===================================================================
--- torvm/trunk/build/win32/src/pkg/bundle.nsi	2009-03-10 04:48:59 UTC (rev 18846)
+++ torvm/trunk/build/win32/src/pkg/bundle.nsi	2009-03-10 05:59:48 UTC (rev 18847)
@@ -40,6 +40,7 @@
 SectionEnd
 
 Function ExtractPackages
+	File "license.msi"
 	File "torvm.msi"
 	File "torbutton.msi"
 	File "thandy.msi"
@@ -48,6 +49,7 @@
 FunctionEnd
 
 Function RunInstallers
+	ExecWait 'msiexec /i "$INSTDIR\license.msi" /qn'
 	ExecWait 'msiexec /i "$INSTDIR\torvm.msi" BUNDLE=1 /qn'
 	ExecWait 'msiexec /i "$INSTDIR\thandy.msi" NOSC=1 /qn'
 	ExecWait 'msiexec /i "$INSTDIR\polipo.msi" NOSC=1 /qn'

Modified: torvm/trunk/build/win32/src/pkg/netinst.nsi
===================================================================
--- torvm/trunk/build/win32/src/pkg/netinst.nsi	2009-03-10 04:48:59 UTC (rev 18846)
+++ torvm/trunk/build/win32/src/pkg/netinst.nsi	2009-03-10 05:59:48 UTC (rev 18847)
@@ -40,11 +40,13 @@
 SectionEnd
 
 Function ExtractPackages
+	File "license.msi"
 	File "thandy.msi"
 FunctionEnd
 
 Function RunInstallers
-	ExecWait 'msiexec /i "$INSTDIR\thandy.msi" ALLUSERS=1 NOSC=1 /qn'
+	ExecWait 'msiexec /i "$INSTDIR\license.msi" /qn'
+	ExecWait 'msiexec /i "$INSTDIR\thandy.msi" NOSC=1 /qn'
 	ExecWait '"$PROGRAMFILES\Thandy\thandy.exe" update "--repo=$PROGRAMFILES\Thandy\TorVM Updates" /bundleinfo/torvm/win32/'
 	ExecWait '"$PROGRAMFILES\Thandy\thandy.exe" update "--repo=$PROGRAMFILES\Thandy\Polipo Updates" /bundleinfo/polipo/win32/'
 	ExecWait '"$PROGRAMFILES\Thandy\thandy.exe" update "--repo=$PROGRAMFILES\Thandy\TorButton Updates" /bundleinfo/torbutton/win32/'

Modified: torvm/trunk/build/win32/src/pkg/torvm.wxs
===================================================================
--- torvm/trunk/build/win32/src/pkg/torvm.wxs	2009-03-10 04:48:59 UTC (rev 18846)
+++ torvm/trunk/build/win32/src/pkg/torvm.wxs	2009-03-10 05:59:48 UTC (rev 18847)
@@ -6,12 +6,6 @@
   
   <?define CurrProductGUID="8b88858f-1d36-461c-9541-e6ffddeb8e69" ?>
   <?define CurrExecutableGUID="f41f7690-d4e6-4c14-a754-fde93b98bb7b" ?>
-  <?define CurrQemuGUID="9a986ae8-1c05-41f8-bd26-4e3d951dc446" ?>
-  <?define CurrBiosGUID="1671260a-0b61-4351-ba93-556fddefd4ce" ?>
-  <?define CurrPThreadLibsGUID="c5960568-ffc8-4c5c-8253-9954d095afdc" ?>
-  <?define CurrDiskImageGUID="72e2fe60-9aac-473b-890e-07ea827b42ce" ?>
-  <?define CurrDocumentsGUID="1163f2e3-a0d0-4f6c-a412-dc27f8e9b338" ?>
-  <?define CurrConfigFileGUID="cd65d655-faba-46d5-b9a8-3958335e9e08" ?>
   <?define CurrStartMenuGUID="928c4898-19e4-4b7a-ad02-95aadb80d3ba" ?>
   <?define CurrDesktopGUID="cc7b92b8-45a5-4958-b530-5e10a2582902" ?>
   <?define CurrDocsOnDesktopGUID="e032e77d-dbfe-4fe8-a2a4-84b5ff20e6af" ?>
@@ -32,7 +26,8 @@
     <Media Id="1" Cabinet="TorVM.cab" CompressionLevel="high"
            EmbedCab="yes" DiskPrompt="CD-ROM #1" />
     <Property Id="DiskPrompt" Value="Tor VM $(var.ThisProductVersionDisp) Installation Volume [1]" />
-    <Property Id="ALLUSERS" Secure="yes"/>
+    <Property Id="ALLUSERS" Secure="yes" />
+    <Property Id="BUNDLE" Secure="yes" />
     <Property Id="ReinstallModeText">omus</Property>
 
     <!-- Associate this package with the upgrade code for this series
@@ -65,64 +60,9 @@
             <RegistryValue Name="Version" Value="$(var.ThisProductVersionDisp)" Type="string" KeyPath="yes" />
           </RegistryKey>
           <File Id="TorVMExe" DiskId="1"
-                Name="torvm.exe" Source="Tor_VM\torvm.exe" />
+                Name="torvm.exe" Source="torvm.exe" />
         </Component>
 
-        <!-- Qemu-related files -->
-        <Component Id="Qemu" Guid="$(var.CurrQemuGUID)">
-          <RegistryKey Root="HKCU" Key="Software\Tor VM" Action="createAndRemoveOnUninstall">
-            <RegistryValue Name="Qemu" Value="1" Type="integer" KeyPath="yes" />
-          </RegistryKey>
-          <File Id="QemuEXE" DiskId="1"
-                Name="qemu.exe" Source="Tor_VM/bin/qemu.exe" />
-          <File Id="DevconEXE" DiskId="1"
-                Name="devcon.exe" Source="Tor_VM/bin/devcon.exe" />
-          <File Id="SDLDll" DiskId="1"
-                Name="SDL.dll" Source="Tor_VM/lib/SDL.dll" />
-          <File Id="NPFDriver" DiskId="1"
-                Name="tornpf.sys" Source="Tor_VM/lib/tornpf.sys" />
-          <File Id="PcapDll" DiskId="1"
-                Name="torpcap.dll" Source="Tor_VM/lib/torpcap.dll" />
-          <File Id="PacketDll" DiskId="1"
-                Name="torpkt.dll" Source="Tor_VM/lib/torpkt.dll" />
-          <File Id="TapInf" DiskId="1"
-                Name="tortap91.inf" Source="Tor_VM/lib/tortap91.inf" />
-          <File Id="TapDriver" DiskId="1"
-                Name="tortap91.sys" Source="Tor_VM/lib/tortap91.sys" />
-        </Component>
-
-        <!-- pthread library files -->
-        <Component Id="PThreadLibrary" Guid="$(var.CurrPThreadLibsGUID)">
-          <RegistryKey Root="HKCU" Key="Software\Tor VM" Action="createAndRemoveOnUninstall">
-            <RegistryValue Name="PThreadLibrary" Value="1" Type="integer" KeyPath="yes" />
-          </RegistryKey>
-          <File Id="pthreadsDll" DiskId="1"
-                Name="pthreadGC2.dll" Source="Tor_VM/lib/pthreadGC2.dll" />
-        </Component>
-
-        <!-- Qemu BIOS files -->
-        <Component Id="Bios" Guid="$(var.CurrBiosGUID)">
-          <RegistryKey Root="HKCU" Key="Software\Tor VM" Action="createAndRemoveOnUninstall">
-            <RegistryValue Name="Bios" Value="1" Type="integer" KeyPath="yes" />
-          </RegistryKey>
-          <File Id="zlibdll" DiskId="1"
-                Name="zlib1.dll" Source="bin\zlib1.dll" />
-        </Component>
-
-        <Component Id="DiskImage" Guid="$(var.CurrDiskImageGUID)">
-          <RegistryKey Root="HKCU" Key="Software\Tor VM" Action="createAndRemoveOnUninstall">
-            <RegistryValue Name="DiskImageFile" Value="1" Type="integer" KeyPath="yes" />
-          </RegistryKey>
-          <File
-            Id="DiskImageFile"
-            Name="hdd.img"
-            Source="Tor_VM/lib/hdd.img"
-            Vital="yes"
-            ReadOnly="no"
-            DiskId="1"
-          /> 
-        </Component>
-
         </Directory>
       </Directory>
 
@@ -170,10 +110,6 @@
                AllowAdvertise="no" Absent="disallow" Level="1"
                Description="Main application">
         <ComponentRef Id="TorVMExecutable" />
-        <ComponentRef Id="Qemu" />
-        <ComponentRef Id="PThreadLibrary" />
-        <ComponentRef Id="Bios" />
-        <ComponentRef Id="DiskImage" />
       </Feature>
       <Feature Id="Shortcuts" Title="Shortcuts"
                AllowAdvertise="no" Absent="allow" Level="1"
@@ -204,7 +140,7 @@
     <!-- Set the UI options -->
     <UIRef Id="WixUI_Custom" />
     <Icon Id="torvm.ico" SourceFile="torvm.ico" />
-    <WixVariable Id="WixUIBannerBmp" Value="header.bmp" />
-    <WixVariable Id="WixUIDialogBmp" Value="welcome.bmp" />
+    <WixVariable Id="WixUIBannerBmp" Value="default-header.bmp" />
+    <WixVariable Id="WixUIDialogBmp" Value="default-welcome.bmp" />
   </Product>
 </Wix>



More information about the tor-commits mailing list