Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Commit 92b8318

Browse files
committed
Can't Find Final Builder 7 Executable on 64 Bit OS (Bug #264)
1 parent cab258c commit 92b8318

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

project/UnitTests/Core/Tasks/FinalBuilderTaskTest.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,31 @@ public void BuildCommandLine()
6161
Assert.AreEqual(ProcessResultOutput, _result.TaskOutput);
6262
}
6363

64+
65+
[Test]
66+
public void BuildCommandLineOn64BitOs()
67+
{
68+
string expectedArgs = @"/B /S /Vvar1=value1;var2=""value 2"" /P" + StringUtil.AutoDoubleQuoteString(Path.Combine(DefaultWorkingDirectory, "TestProject.fbz5"));
69+
ExpectToExecuteArguments(expectedArgs);
70+
71+
_mockRegistry.ExpectAndReturn("GetLocalMachineSubKeyValue", null, @"SOFTWARE\VSoft\FinalBuilder\5.0", "Location");
72+
_mockRegistry.ExpectAndReturn("GetLocalMachineSubKeyValue", Path.Combine(DefaultWorkingDirectory, "FinalBuilder5.exe"), @"SOFTWARE\Wow6432Node\VSoft\FinalBuilder\5.0", "Location");
73+
74+
_task.FBVariables = new FBVariable[2];
75+
_task.FBVariables[0] = new FBVariable("var1", "value1");
76+
_task.FBVariables[1] = new FBVariable("var2", "value 2");
77+
_task.ProjectFile = Path.Combine(DefaultWorkingDirectory, "TestProject.fbz5");
78+
_task.ShowBanner = false;
79+
_task.DontWriteToLog = true;
80+
_task.Timeout = 600;
81+
_task.Run(_result);
82+
83+
Assert.AreEqual(1, _result.TaskResults.Count);
84+
Assert.AreEqual(IntegrationStatus.Success, _result.Status);
85+
Assert.AreEqual(ProcessResultOutput, _result.TaskOutput);
86+
}
87+
88+
6489
[Test]
6590
public void DoubleQuoteSpacesinPaths()
6691
{
@@ -166,6 +191,8 @@ public void FinalBuilderIsNotInstalled()
166191
{
167192
ExpectThatExecuteWillNotBeCalled();
168193
_mockRegistry.ExpectAndReturn("GetLocalMachineSubKeyValue", null, @"SOFTWARE\VSoft\FinalBuilder\5.0", "Location");
194+
_mockRegistry.ExpectAndReturn("GetLocalMachineSubKeyValue", null, @"SOFTWARE\Wow6432Node\VSoft\FinalBuilder\5.0", "Location");
195+
169196
_task.ProjectFile = @"C:\Dummy\Project.fbz5";
170197
Assert.That(delegate { _task.Run(_result); },
171198
Throws.TypeOf<BuilderException>().With.Message.EqualTo("Path to Finalbuilder 5 command line executable could not be found."));

project/core/tasks/FinalBuilderTask.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,17 @@ public string GetFBPath()
320320
{
321321
int fbversion = GetFBVersion();
322322
string keyName = String.Format(CultureInfo.CurrentCulture, @"SOFTWARE\VSoft\FinalBuilder\{0}.0", fbversion); // Works for FB 3 through 5, should work for future versions
323+
string keyName64 = String.Format(CultureInfo.CurrentCulture, @"SOFTWARE\Wow6432Node\VSoft\FinalBuilder\{0}.0", fbversion); // for 64 bits os
323324

324325
string executableDir = _registry.GetLocalMachineSubKeyValue(keyName, "Location");
325326
if (string.IsNullOrEmpty((executableDir)))
326-
{
327-
throw new BuilderException(this, string.Format(System.Globalization.CultureInfo.CurrentCulture,"Path to Finalbuilder {0} command line executable could not be found.", fbversion));
328-
}
327+
{
328+
executableDir = _registry.GetLocalMachineSubKeyValue(keyName64, "Location");
329+
if (string.IsNullOrEmpty((executableDir)))
330+
{
331+
throw new BuilderException(this, string.Format(System.Globalization.CultureInfo.CurrentCulture, "Path to Finalbuilder {0} command line executable could not be found.", fbversion));
332+
}
333+
}
329334

330335
if (fbversion == 3) // FinalBuilder 3 has a different executable name to other versions
331336
{

0 commit comments

Comments
 (0)