summaryrefslogtreecommitdiff
path: root/build/windows
diff options
context:
space:
mode:
authorGabriel Burt <gabriel.burt@gmail.com>2011-02-26 12:17:05 -0600
committerGabriel Burt <gabriel.burt@gmail.com>2011-02-26 12:17:21 -0600
commitb73d964af2e6e91f447517eab0c39c933aee0770 (patch)
tree63b84728f2a5fb4e418b81683d379892bc2bc055 /build/windows
parent0f405336942a8a26654712030dce417faf1f1c61 (diff)
windows: Clean up build-installer.js script a bit
Diffstat (limited to 'build/windows')
-rw-r--r--build/windows/build-installer.js58
1 files changed, 22 insertions, 36 deletions
diff --git a/build/windows/build-installer.js b/build/windows/build-installer.js
index 5590d0a0f..e6199728a 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 ();
}