From ca9ed0a9798b1d44541a73950a01f1f5b4e3b442 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 5 May 2011 13:11:57 -0400 Subject: CREATE_PROJECT: Pass architecture to nsis setup in post-build step --- devtools/create_project/scripts/installer.vbs | 16 ++++++++++++++-- devtools/create_project/scripts/postbuild.cmd | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'devtools/create_project/scripts') diff --git a/devtools/create_project/scripts/installer.vbs b/devtools/create_project/scripts/installer.vbs index 716fa279a9..6bcd794bef 100644 --- a/devtools/create_project/scripts/installer.vbs +++ b/devtools/create_project/scripts/installer.vbs @@ -43,6 +43,7 @@ Dim WshShell : Set WshShell = CreateObject("WScript.Shell") ' Folders Dim rootFolder : rootFolder = "" Dim targetFolder : targetFolder = "" +Dim arch : arch = "" ' Parse our command line arguments If ParseCommandLine() Then @@ -59,11 +60,21 @@ Sub CreateInstaller() Exit Sub End If + ' Preprocess architecture + Select Case arch + Case "x86" + arch = "win32" + + Case "x64" + arch = "win64" + End Select + ' Build command line Dim commandLine : commandLine = """" & nsisPath & "\makensis.exe"" /V2" & _ " /Dtop_srcdir=""" & rootFolder & """" & _ " /Dbuild_dir=""" & targetFolder & """" & _ " /Dtext_dir=""" & targetFolder & """" & _ + " /DARCH=""" & arch & """" & _ " """ & rootFolder & "\dists\nsis\scummvm.nsi""" Dim oExec: Set oExec = WshShell.Exec(commandline) @@ -115,8 +126,8 @@ End Function Function ParseCommandLine() ParseCommandLine = True - If Wscript.Arguments.Count <> 2 Then - Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 2)" + If Wscript.Arguments.Count <> 3 Then + Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 3)" ParseCommandLine = False Exit Function @@ -125,6 +136,7 @@ Function ParseCommandLine() ' Get our arguments rootFolder = Wscript.Arguments.Item(0) targetFolder = Wscript.Arguments.Item(1) + arch = Wscript.Arguments.Item(2) ' Check that the folders are valid If Not FSO.FolderExists(rootFolder) Then diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd index da61afcc3c..e78861463a 100644 --- a/devtools/create_project/scripts/postbuild.cmd +++ b/devtools/create_project/scripts/postbuild.cmd @@ -45,7 +45,7 @@ if "%~5"=="0" goto done echo Running installer script echo. -@call cscript "%~1/devtools/create_project/scripts/installer.vbs" %~1 %~2 1>NUL +@call cscript "%~1/devtools/create_project/scripts/installer.vbs" %~1 %~2 %~3 1>NUL if not %errorlevel% == 0 goto error_script goto done -- cgit v1.2.3