Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenVandezande committed Jan 30, 2013
2 parents 82679ab + 2df728c commit 464e206
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
12 changes: 11 additions & 1 deletion RemObjects.Train/API/Delphi.pas
Expand Up @@ -50,6 +50,9 @@ interface
VersionInfo = public class
private
public
constructor ();
property codePage: UInt16;
property resLang: UInt16;
property isDll: Boolean;
property version: String;
property fileVersion: String;
Expand Down Expand Up @@ -191,7 +194,8 @@ implementation

if aVersion <> nil then begin
var pev := new Win32VersionInfoResource();
pev.ResLang := 0;
pev.CodePage := aVersion.codePage;
pev.ResLang := aVersion.resLang;
pev.IsDll := aVersion.isDll;
var lVer := ParseVersion(coalesce(aVersion.version, ''));
var lFileVer := ParseVersion(coalesce(aVersion.fileVersion,aVersion.version, ''));
Expand Down Expand Up @@ -251,4 +255,10 @@ implementation
end;
end;

constructor VersionInfo();
begin
codePage := 1252;
resLang := 1033;
end;

end.
9 changes: 5 additions & 4 deletions RemObjects.Train/API/Innosetup.pas
Expand Up @@ -15,7 +15,7 @@ interface
method &Register(aServices: IApiRegistrationServices);

[WrapAs('inno.build')]
class method InnoBuild(aServices: IApiRegistrationServices; aFilename: String; aOptions: InnoSetupOptions);
class method InnoBuild(aServices: IApiRegistrationServices; ec: RemObjects.Script.EcmaScript.ExecutionContext; aFilename: String; aOptions: InnoSetupOptions);
end;

InnoSetupOptions = public class
Expand All @@ -33,8 +33,9 @@ implementation
.AddValue('build', RemObjects.Train.MUtilities.SimpleFunction(aServices.Engine, typeOf(InnoSetupPlugin), 'InnoBuild'));
end;

class method InnoSetupPlugin.InnoBuild(aServices: IApiRegistrationServices; aFilename: String; aOptions: InnoSetupOptions);
class method InnoSetupPlugin.InnoBuild(aServices: IApiRegistrationServices; ec: RemObjects.Script.EcmaScript.ExecutionContext; aFilename: String; aOptions: InnoSetupOptions);
begin
aFilename := aServices.ResolveWithBase(ec, aFilename);
var lPath := String(aServices.Environment['InnoSetup']);
if String.IsNullOrEmpty(lPath) then
lPath := String(Microsoft.Win32.Registry.GetValue('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 5_is1', 'InstallLocation', ''));
Expand All @@ -46,7 +47,7 @@ implementation
var sb := new StringBuilder;
sb.AppendFormat('"{0}"', aFilename);
if not String.IsNullOrEmpty(aOptions:destinationFolder) then
sb.AppendFormat(' /O"{0}"', aOptions.destinationFolder);
sb.AppendFormat(' /O"{0}"', aServices.ResolveWithBase(ec, aOptions.destinationFolder));


if aOptions <> nil then begin
Expand All @@ -57,7 +58,7 @@ implementation
end;

var lOutput:= new StringBuilder;
var n:= Shell.ExecuteProcess(lPath, sb.ToString, nil,false ,
var n:= Shell.ExecuteProcess(lPath, sb.ToString, aServices.WorkDir,false ,
a-> locking lOutput do lOutput.Append(a),a-> locking lOutput do lOutput.Append(a), nil, nil);


Expand Down
1 change: 1 addition & 0 deletions RemObjects.Train/API/Interfaces.pas
Expand Up @@ -14,6 +14,7 @@ interface
method RegisterTask(aTask: System.Threading.Tasks.Task; aSignature: String; aLogger: DelayedLogger);
method UnregisterTask(aTask: System.Threading.Tasks.Task);

property WorkDir: String read;
property Environment: Environment read;
property Globals: GlobalObject read;
property Engine: Engine read;
Expand Down
2 changes: 1 addition & 1 deletion RemObjects.Train/API/Resources.pas
Expand Up @@ -435,7 +435,7 @@ constructor UnmanagedResourceFile;
wr.Write(0 as System.UInt16);
wr.Write(0 as System.UInt16);
wr.Write(0 as System.UInt16);
b := Encoding.Unicode.GetBytes(String.Format('{0:X4}{1:X4}', CodePage, ResLang));
b := Encoding.Unicode.GetBytes(String.Format('{0:X4}{1:X4}', ResLang, CodePage));
wr.Write(b);
wr.Write(0 as System.UInt16);
var z: System.UInt16;
Expand Down

0 comments on commit 464e206

Please sign in to comment.