[banshee] windows: Clean up build-installer.js script a bit



commit b73d964af2e6e91f447517eab0c39c933aee0770
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Sat Feb 26 12:17:05 2011 -0600

    windows: Clean up build-installer.js script a bit

 build/windows/build-installer.js |   58 ++++++++++++++-----------------------
 1 files changed, 22 insertions(+), 36 deletions(-)
---
diff --git a/build/windows/build-installer.js b/build/windows/build-installer.js
index 5590d0a..e619972 100644
--- a/build/windows/build-installer.js
+++ b/build/windows/build-installer.js
@@ -3,28 +3,23 @@
 
 // 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");
-
 var heat = "\"" + env("WIX") + "bin\\heat.exe\"";
 
 // Look for msbuild.exe
-if (fs.FileExists(env("windir") + "\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe") == 1){
-	var msbuild = env("windir") + "\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe"
-}
-else if (fs.FileExists(env("windir") + "\\Microsoft.NET\\Framework\\v3.5\\msbuild.exe") == 1){
-	var msbuild = env("windir") + "\\Microsoft.NET\\Framework\\v3.5\\msbuild.exe"
-}
-else {
-	WScript.Echo ('Build failed: Microsoft.NET MSBuild \(msbuild.exe\) not found');
-	WScript.Quit (1);
+if (fs.FileExists (env("windir") + "\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe") == 1) {
+  var msbuild = env("windir") + "\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe"
+} else if (fs.FileExists(env("windir") + "\\Microsoft.NET\\Framework\\v3.5\\msbuild.exe") == 1) {
+  var msbuild = env("windir") + "\\Microsoft.NET\\Framework\\v3.5\\msbuild.exe"
+} else {
+  WScript.Echo ('Build failed: Microsoft.NET MSBuild \(msbuild.exe\) not found');
+  WScript.Quit (1);
 }
 
-// Build Banshee
+// Could build Banshee from here, but atm at least I prefer to assume it's already built
 //build ("..\\..\\Banshee.sln");
 
 // Delete some files that might be created by running uninstalled
@@ -39,7 +34,6 @@ heatDir ("share");
 
 // 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)
@@ -59,35 +53,27 @@ function heatDir (dir)
 
 function run (cmd)
 {
-	if (sh.run (cmd, 5, true) != 0) {
-		WScript.Echo ("Failed to run cmd:\n" + cmd);
-	  WScript.Quit (1);
+  if (sh.run (cmd, 5, true) != 0) {
+    WScript.Echo ("Failed to run cmd:\n" + cmd);
+    WScript.Quit (1);
   }
 }
 
 function build (file)
 {
-	if (sh.run (msbuild + " " + file, 5, true) != 0) {
-		WScript.Echo ("Build failed");
-		WScript.Quit (1);
-	}
+  if (sh.run (msbuild + " " + file, 5, true) != 0) {
+    WScript.Echo ("Build failed");
+    WScript.Quit (1);
+  }
 }
 
 function regexreplace (file, regex, replacement)
 {
-   var f = fs.OpenTextFile (file, 1);
-   var content = f.ReadAll ();
-   f.Close ();
-   content = content.replace (regex, replacement);
-   f = fs.CreateTextFile (file, true);
-   f.Write (content);
-   f.Close ();
-}
-
-function format (num, len)
-{
-	var res = num.toString ();
-	while (res.length < len)
-		res = "0" + res;
-	return res;
+  var f = fs.OpenTextFile (file, 1);
+  var content = f.ReadAll ();
+  f.Close ();
+  content = content.replace (regex, replacement);
+  f = fs.CreateTextFile (file, true);
+  f.Write (content);
+  f.Close ();
 }



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