[banshee] windows: Many improvements to installer



commit 2edcea0f95a5615c638a4557c8ae2cf48511f28c
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Thu Feb 3 10:25:28 2011 -0600

    windows: Many improvements to installer
    
    With up to date bin/ repo and built Banshee -- and nothing else -- should be
    able to produce a working Banshee install(er).

 build/windows/InstallerDefinition.wxs |   54 ++++++++++++++++++++-------------
 build/windows/README.txt              |    2 +-
 build/windows/build-installer.js      |   49 +++++++++++++----------------
 build/windows/post-build.bat          |    8 +++++
 build/windows/update-scripts          |   13 +++++++-
 5 files changed, 75 insertions(+), 51 deletions(-)
---
diff --git a/build/windows/InstallerDefinition.wxs b/build/windows/InstallerDefinition.wxs
index 3524b4b..7ecab2f 100644
--- a/build/windows/InstallerDefinition.wxs
+++ b/build/windows/InstallerDefinition.wxs
@@ -6,8 +6,10 @@
 <?define UpgradeCode = "9134F74C-E7E3-471A-9833-F86FB45CD38E" ?>
 
 <?define BuildRoot= "..\.." ?>
-<?define BinDir= "..\..\bin" ?>
-<?define ShareDir= "..\..\bin\share" ?>
+<?define binDir= "..\..\bin\bin" ?>
+<?define etcDir= "..\..\bin\etc" ?>
+<?define libDir= "..\..\bin\lib" ?>
+<?define shareDir= "..\..\bin\share" ?>
 
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
   <Product Id="*" Name="$(var.ProductShortName) $(var.ProductVersionText)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
@@ -42,33 +44,41 @@
     <Directory Id="TARGETDIR" Name="SourceDir">
       <Directory Id="ProgramFilesFolder">
         <Directory Id="INSTALLLOCATION" Name="Banshee" FileSource="$(var.BuildRoot)\bin">
-          <Component Id="ProductComponent" Guid="38703ED9-C1D1-4DC5-834B-31B8059BF7DF">
-            <File Name="Nereid.exe">
-              <Shortcut Id="banshee_shortcut" Directory="ProgramMenuDir" Name="$(var.ProductShortName)" WorkingDirectory="bin" Icon="Nereid.exe" IconIndex="0" Advertise="yes" />
-            </File>
-
-            <!-- Program Menu Shortcut -->
-            <RemoveFolder Id='ProgramMenuDir' Directory="ProgramMenuDir" On='uninstall' />
-                              
-            <!-- GTK# path -->
-            <RegistryValue Root='HKLM' Key='SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Nereid.exe' Type='string' Name='Path' Value='[GTKSHARPPATH]\bin' />
-
-            <!-- Place Banshee path into registry -->
-            <RegistryValue Root='HKLM' Key='SOFTWARE\Novell\Banshee' Type='string' Name='Version' Value='$(var.ProductVersion)' />
-            <RegistryValue Root='HKLM' Key='SOFTWARE\Novell\Banshee' Type='string' Name='Path' Value='[INSTALLLOCATION]' />
+          <Directory Id="bin" Name="bin">
+            <Component Id="ProductComponent" Guid="38703ED9-C1D1-4DC5-834B-31B8059BF7DF">
+              <!-- Place Banshee path into registry -->
+              <RegistryValue Root='HKLM' Key='SOFTWARE\Novell\Banshee' Type='string' Name='Version' Value='$(var.ProductVersion)' />
+              <RegistryValue Root='HKLM' Key='SOFTWARE\Novell\Banshee' Type='string' Name='Path' Value='[INSTALLLOCATION]' />
+            </Component>
+          </Directory>
+        </Directory>
+      </Directory>
 
+      <Directory Id="ProgramMenuFolder" Name="PMenu">
+        <Directory Id="ProgramMenuDir" Name='$(var.ProductShortName)'>
+          <Component Id="StartMenuShortcut" Guid="165DF12B-D970-49BC-B03B-880B62ABC308">
+            <Shortcut Id="StartMenuShortcut" Name="$(var.ProductShortName)" Icon="Nereid.exe" Target="[INSTALLLOCATION]bin\Nereid.exe" WorkingDirectory="bin"/>
+            <RemoveFolder Id="ProgramMenuSubfolder" On="uninstall"/>
+            <RegistryValue Root="HKCU" Key="Software\$(var.Manufacturer)\$(var.ProductShortName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
           </Component>
         </Directory>
       </Directory>
 
-      <Directory Id="ProgramMenuFolder" Name="PMenu">
-        <Directory Id="ProgramMenuDir" Name='$(var.ProductShortName)' />
+      <Directory Id="DesktopFolder">
+        <Component Id="DesktopShortcut" Guid="ACCE1EDB-87E3-4FE5-B2BF-93113E767381">
+          <Shortcut Id="DesktopShortcut" Name="$(var.ProductShortName)" Icon="Nereid.exe" Target="[INSTALLLOCATION]bin\Nereid.exe" WorkingDirectory="bin"/>
+          <RegistryValue Root="HKCU" Key="Software\$(var.Manufacturer)\$(var.ProductShortName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
+        </Component>
       </Directory>
     </Directory>
 
     <Feature Id="ProductFeature" Title="Banshee" Level="1">
       <ComponentRef Id="ProductComponent" />
-      <ComponentGroupRef Id="binaries" />
+      <ComponentRef Id="StartMenuShortcut" />
+      <ComponentRef Id="DesktopShortcut" />
+      <ComponentGroupRef Id="bin" />
+      <ComponentGroupRef Id="etc" />
+      <ComponentGroupRef Id="lib" />
       <ComponentGroupRef Id="share" />
     </Feature>
 
@@ -95,6 +105,8 @@
     <Property Id="ARPHELPLINK" Value="http://banshee.fm/"; />
   </Product>
 
-  <?include generated_share.wxi ?>
-  <?include generated_binaries.wxi ?>
+  <?include obj\generated_bin.wxi ?>
+  <?include obj\generated_etc.wxi ?>
+  <?include obj\generated_lib.wxi ?>
+  <?include obj\generated_share.wxi ?>
 </Wix>
diff --git a/build/windows/README.txt b/build/windows/README.txt
index ec0a8aa..588e8e8 100644
--- a/build/windows/README.txt
+++ b/build/windows/README.txt
@@ -6,7 +6,7 @@ Banshee on Windows.
 == Creating the Banshee.msi installer ==
 
 You need
-- WIX 3.5
+- WIX 3.5 installed
 - Banshee built
 
 With that, you should be able to run build-installer.js and have it produce the
diff --git a/build/windows/build-installer.js b/build/windows/build-installer.js
index 82b8203..fae98d9 100644
--- a/build/windows/build-installer.js
+++ b/build/windows/build-installer.js
@@ -1,50 +1,45 @@
 // This script was started by copying MonoDevelop's, available at 
 // https://github.com/mono/monodevelop/tree/master/setup/WixSetup
 
+// HEAT manual: http://wix.sourceforge.net/manual-wix3/heat.htm
+
 var version = "1.9.3";
+var bin = '..\\..\\bin';
 
 var sh = new ActiveXObject("WScript.Shell");
 var fs = new ActiveXObject("Scripting.FileSystemObject");
-
 var env = sh.Environment("Process");
 
-// FIXME if heat isn't here, it might be at v3.x\bin
 var heat = "\"" + env("WIX") + "bin\\heat.exe\"";
 
 // Build Banshee
 //build ("..\\..\\Banshee.sln");
 
-// Copy binaries into a new folder so we can generate a file list w/o .git/* being included
-if (fs.FolderExists ("dlls")) fs.DeleteFolder ("dlls");
-fs.CreateFolder ("dlls");
-run ('xcopy /D ..\\..\\bin\\*.dll dlls\\');
-run ('xcopy /D ..\\..\\bin\\*.config dlls\\');
-run ('xcopy /D ..\\..\\bin\\*.pdb dlls\\');
-run ('xcopy /D ..\\..\\bin\\*.exe dlls\\');
-fs.CreateFolder ("dlls\\gst-plugins");
-run ('xcopy /D ..\\..\\bin\\gst-plugins\\* dlls\\gst-plugins\\');
-
-// We already mention Nereid.exe specifically in Product.wxs so we can make a shortcut based off it
-if (fs.FileExists ("dlls\\Nereid.exe")) fs.DeleteFile ("dlls\\Nereid.exe");
-
-// Generate the list of binary files (managed and native .dlls and .pdb and .config files)
-run (heat + ' dir dlls -cg binaries -srd -scom -sreg -ag -sfrag -suid -indent 2 -var var.BinDir -dr INSTALLLOCATION -out generated_binaries.wxi');
-if (fs.FolderExists ("dlls")) fs.DeleteFolder ("dlls");
-
-// Heat has no option to output Include (wxi) files instead of Wix (wxs) ones, so do a little regex
-regexreplace ('generated_binaries.wxi', /Wix xmlns/, 'Include xmlns');
-regexreplace ('generated_binaries.wxi', /Wix>/, 'Include>');
+// Delete some files that might be created by running uninstalled
+if (fs.FileExists ("registry.bin")) fs.DeleteFile ("registry.bin");
+if (fs.FolderExists ("addin-db-001")) fs.DeleteFolder ("addin-db-001");
 
-// Generate the list of files in share/ (icons, i18n, and GStreamer audio-profiles)
-run (heat + ' dir ..\\..\\bin\\share -cg share -scom -ag -sfrag -suid -indent 2 -var var.ShareDir -dr INSTALLLOCATION -out generated_share.wxi');
-regexreplace ('generated_share.wxi', /Wix xmlns/, 'Include xmlns');
-regexreplace ('generated_share.wxi', /Wix>/, 'Include>');
+// We can't just heat the entire dir b/c it would include the .git/ directory
+heatDir ("bin");
+heatDir ("etc");
+heatDir ("lib");
+heatDir ("share");
 
-// Create the installer, will be outputted to bin/Debug/
+// Create the installer, will be outputted to Banshee-1.9.3.msi in build/windows/
 build ("Installer.wixproj")
 
 WScript.Echo ("Setup successfully generated");
 
+function heatDir (dir)
+{
+  // Generate the list of binary files (managed and native .dlls and .pdb and .config files)
+  run (heat + ' dir ..\\..\\bin\\' + dir + ' -cg ' + dir + ' -scom -sreg -ag -sfrag -indent 2 -var var.' + dir + 'Dir -dr INSTALLLOCATION -out obj\\generated_'+dir+'.wxi');
+
+  // Heat has no option to output Include (wxi) files instead of Wix (wxs) ones, so do a little regex
+  regexreplace ('obj\\generated_'+dir+'.wxi', /Wix xmlns/, 'Include xmlns');
+  regexreplace ('obj\\generated_'+dir+'.wxi', /Wix>/, 'Include>');
+}
+
 function run (cmd)
 {
 	if (sh.run (cmd, 5, true) != 0) {
diff --git a/build/windows/post-build.bat b/build/windows/post-build.bat
index 248b4fa..bdaf9bd 100644
--- a/build/windows/post-build.bat
+++ b/build/windows/post-build.bat
@@ -1,3 +1,5 @@
+REM This file is called/ran after Banshee.Core.dll is built, see src/Core/Banshee.Core/Banshee.Core.csproj
+
 mkdir bin\share\icons\hicolor\128x128\devices
 mkdir bin\share\icons\hicolor\16x16\actions
 mkdir bin\share\icons\hicolor\16x16\categories
@@ -132,6 +134,12 @@ copy /Y "src\Extensions\Banshee.Wikipedia\ThemeIcons\48x48\categories\wikipedia.
 copy /Y "src\Extensions\Banshee.YouTube\ThemeIcons\16x16\categories\youtube.png" bin\share\icons\hicolor\16x16\categories\youtube.png
 copy /Y "src\Extensions\Banshee.YouTube\ThemeIcons\22x22\categories\youtube.png" bin\share\icons\hicolor\22x22\categories\youtube.png
 copy /Y "src\Extensions\Banshee.YouTube\ThemeIcons\24x24\categories\youtube.png" bin\share\icons\hicolor\24x24\categories\youtube.png
+mkdir bin\share\icons\hicolor\16x16\apps
+mkdir bin\share\icons\hicolor\192x192\apps
+mkdir bin\share\icons\hicolor\22x22\apps
+mkdir bin\share\icons\hicolor\24x24\apps
+mkdir bin\share\icons\hicolor\32x32\apps
+mkdir bin\share\icons\hicolor\48x48\apps
 copy /Y data\icon-theme-hicolor\media-player-banshee-16.png bin\share\icons\hicolor\16x16\apps\media-player-banshee.png
 copy /Y data\icon-theme-hicolor\media-player-banshee-192.png bin\share\icons\hicolor\192x192\apps\media-player-banshee.png
 copy /Y data\icon-theme-hicolor\media-player-banshee-22.png bin\share\icons\hicolor\22x22\apps\media-player-banshee.png
diff --git a/build/windows/update-scripts b/build/windows/update-scripts
index 240a22f..4e1aad3 100755
--- a/build/windows/update-scripts
+++ b/build/windows/update-scripts
@@ -2,6 +2,9 @@
 
 cd ../..
 
+echo "REM This file is called/ran after Banshee.Core.dll is built, see src/Core/Banshee.Core/Banshee.Core.csproj
+"> build/windows/post-build.bat
+
 # Find all ThemeIcon PNGs and produce a Windows BAT script
 # to move them into bin/share/icon/hicolor, creating
 # all necessary directories
@@ -11,9 +14,15 @@ find src/ -name *.png | \
     sed -r 's!^(.*)ThemeIcons((.*)\\.*\.png)$!000GBmkdir DEST\3\ncopy /Y "\0" DEST\2!' | \
     sed 's!DEST!bin\\share\\icons\\hicolor!g' | \
     sort | uniq | \
-    sed 's!000GB!!' > build/windows/post-build.bat
+    sed 's!000GB!!' >> build/windows/post-build.bat
 
-echo "copy /Y data\icon-theme-hicolor\media-player-banshee-16.png bin\share\icons\hicolor\16x16\apps\media-player-banshee.png
+echo "mkdir bin\share\icons\hicolor\16x16\apps
+mkdir bin\share\icons\hicolor\192x192\apps
+mkdir bin\share\icons\hicolor\22x22\apps
+mkdir bin\share\icons\hicolor\24x24\apps
+mkdir bin\share\icons\hicolor\32x32\apps
+mkdir bin\share\icons\hicolor\48x48\apps
+copy /Y data\icon-theme-hicolor\media-player-banshee-16.png bin\share\icons\hicolor\16x16\apps\media-player-banshee.png
 copy /Y data\icon-theme-hicolor\media-player-banshee-192.png bin\share\icons\hicolor\192x192\apps\media-player-banshee.png
 copy /Y data\icon-theme-hicolor\media-player-banshee-22.png bin\share\icons\hicolor\22x22\apps\media-player-banshee.png
 copy /Y data\icon-theme-hicolor\media-player-banshee-24.png bin\share\icons\hicolor\24x24\apps\media-player-banshee.png



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]