Skip to content

Commit

Permalink
Added Assemble, Build, Run
Browse files Browse the repository at this point in the history
Added Assemble, Build, Run capabilities to projects and files
  • Loading branch information
ThomasJaeger committed Feb 28, 2017
1 parent 7b16a91 commit ca80c22
Show file tree
Hide file tree
Showing 23 changed files with 4,934 additions and 175 deletions.
79 changes: 65 additions & 14 deletions Domain/uSharedGlobals.pas
Expand Up @@ -376,7 +376,7 @@ function GPGExecute(const CmdLine: String; var Output, Errors: String;
BLOCK_SIZE = 1024;
var
iBytesRead, iBytesReadTotal: Cardinal;
szBuffer: array[0..BLOCK_SIZE-1] of Char;
szBuffer: array[0..BLOCK_SIZE-1] of AnsiChar;
begin
Result := '';
iBytesReadTotal := 0;
Expand Down Expand Up @@ -425,20 +425,20 @@ function GPGExecute(const CmdLine: String; var Output, Errors: String;
myStartupInfo, myProcessInfo);
// close the ends of the pipes used by the process
CloseHandle(hPipeOutputWrite);
CloseHandle(hPipeErrorWrite);
// could process be started ?
if Result then
begin
// wait until process terminates
if (Wait > 0) then
begin
iWaitRes := WaitForSingleObject(myProcessInfo.hProcess, Wait);
Output := _PipeToString(hPipeOutputRead);
Errors := _PipeToString(hPipeErrorRead);
// timeout reached ?
if (iWaitRes = WAIT_TIMEOUT) then
CloseHandle(hPipeErrorWrite);
// could process be started ?
if Result then
begin
// wait until process terminates
if (Wait > 0) then
begin
iWaitRes := WaitForSingleObject(myProcessInfo.hProcess, Wait);
Output := _PipeToString(hPipeOutputRead);
Errors := _PipeToString(hPipeErrorRead);
// timeout reached ?
if (iWaitRes = WAIT_TIMEOUT) then
begin
Result := False;
Result := False;
TerminateProcess(myProcessInfo.hProcess, 1);
end;
end;
Expand Down Expand Up @@ -644,5 +644,56 @@ function FormatByteSize(const bytes: Longint): string;
result := FormatFloat('#,##0', bytes);
end;

//procedure CaptureConsoleOutput(const ACommand, AParameters: String; AMemo: TMemo);
// const
// CReadBuffer = 2400;
// var
// saSecurity: TSecurityAttributes;
// hRead: THandle;
// hWrite: THandle;
// suiStartup: TStartupInfo;
// piProcess: TProcessInformation;
// pBuffer: array[0..CReadBuffer] of AnsiChar;
// dRead: DWord;
// dRunning: DWord;
// begin
// saSecurity.nLength := SizeOf(TSecurityAttributes);
// saSecurity.bInheritHandle := True;
// saSecurity.lpSecurityDescriptor := nil;
//
// if CreatePipe(hRead, hWrite, @saSecurity, 0) then
// begin
// FillChar(suiStartup, SizeOf(TStartupInfo), #0);
// suiStartup.cb := SizeOf(TStartupInfo);
// suiStartup.hStdInput := hRead;
// suiStartup.hStdOutput := hWrite;
// suiStartup.hStdError := hWrite;
// suiStartup.dwFlags := STARTF_USESTDHANDLES or STARTF_USESHOWWINDOW;
// suiStartup.wShowWindow := SW_HIDE;
//
// if CreateProcess(nil, PChar(ACommand + ' ' + AParameters), @saSecurity,
// @saSecurity, True, NORMAL_PRIORITY_CLASS, nil, nil, suiStartup, piProcess)
// then
// begin
// repeat
// dRunning := WaitForSingleObject(piProcess.hProcess, 100);
// Application.ProcessMessages();
// repeat
// dRead := 0;
// ReadFile(hRead, pBuffer[0], CReadBuffer, dRead, nil);
// pBuffer[dRead] := #0;
//
// OemToAnsi(pBuffer, pBuffer);
// AMemo.Lines.Add(String(pBuffer));
// until (dRead < CReadBuffer);
// until (dRunning <> WAIT_TIMEOUT);
// CloseHandle(piProcess.hProcess);
// CloseHandle(piProcess.hThread);
// end;
//
// CloseHandle(hRead);
// CloseHandle(hWrite);
// end;
//end;

end.
37 changes: 36 additions & 1 deletion Domain/uVisualMASMOptions.pas
Expand Up @@ -98,7 +98,7 @@ constructor TVisualMASMOptions.Create(name: string);
procedure TVisualMASMOptions.SaveFile;
var
fileName: string;
json: TJSONObject;
json, jML32, jML64, jML16: TJSONObject;
fileContent: TStringList;
i: Integer;
begin
Expand Down Expand Up @@ -134,6 +134,25 @@ procedure TVisualMASMOptions.SaveFile;
json.A['LastFilesUsed'].Add(FLastFilesUsed[i].FileName);
end;

jML32 := json.O['ML32'];
jML32.S['FileName'] := FML32.FoundFileName;
jML32.S['Linker32'] := FML32.Linker32Bit.FoundFileName;
jML32.S['Linker16'] := FML32.Linker16Bit.FoundFileName;
jML32.S['RC'] := FML32.RC.FoundFileName;
jML32.S['LIB'] := FML32.LIB.FoundFileName;

jML64 := json.O['ML64'];
jML64.S['FileName'] := FML64.FoundFileName;
jML64.S['Linker32'] := FML64.Linker32Bit.FoundFileName;
jML64.S['RC'] := FML64.RC.FoundFileName;
jML64.S['LIB'] := FML64.LIB.FoundFileName;

jML16 := json.O['ML16'];
jML16.S['FileName'] := FML16.FoundFileName;
jML16.S['Linker16'] := FML16.Linker16Bit.FoundFileName;
jML16.S['RC'] := FML16.RC.FoundFileName;
jML16.S['LIB'] := FML16.LIB.FoundFileName;

fileName := FAppFolder+VISUAL_MASM_FILE;
fileContent := TStringList.Create;
fileContent.Text := json.ToJSON(false);
Expand Down Expand Up @@ -177,6 +196,22 @@ procedure TVisualMASMOptions.LoadFile;
FLastFilesUsed.Insert(0, f);
end;

FML32.FoundFileName := json['ML32'].S['FileName'];
FML32.Linker32Bit.FoundFileName := json['ML32'].S['Linker32'];
FML32.Linker16Bit.FoundFileName := json['ML32'].S['Linker16'];
FML32.RC.FoundFileName := json['ML32'].S['RC'];
FML32.LIB.FoundFileName := json['ML32'].S['LIB'];

FML64.FoundFileName := json['ML64'].S['FileName'];
FML64.Linker32Bit.FoundFileName := json['ML64'].S['Linker32'];
FML64.RC.FoundFileName := json['ML64'].S['RC'];
FML64.LIB.FoundFileName := json['ML64'].S['LIB'];

FML16.FoundFileName := json['ML16'].S['FileName'];
FML16.Linker16Bit.FoundFileName := json['ML16'].S['Linker16'];
FML16.RC.FoundFileName := json['ML16'].S['RC'];
FML16.LIB.FoundFileName := json['ML16'].S['LIB'];

frmMain.Height := FMainFormHeight;
frmMain.Left := FMainFormLeft;
frmMain.Top := FMainFormTop;
Expand Down
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -4,6 +4,12 @@ Create Microsoft Windows and MS-DOS applications with Visual MASM for Microsoft

![visualmasm0](https://cloud.githubusercontent.com/assets/1396719/22631839/aaf84fac-ebe1-11e6-82b2-7e0cc2f74fa4.png)

Update - 02-28-2017
-------------------
- Added Tools -> Options -> File Locations
- Added Setup wizard to download MASM32 package
- Added Assemble, Build, Run capabilities to projects and files

Update - 02-26-2017
-------------------
- Fixes
Expand Down
2 changes: 1 addition & 1 deletion VisualMASM.dpr
Expand Up @@ -47,6 +47,7 @@ begin
Application.MainFormOnTaskbar := True;
Application.Title := 'VisualMASM';
Application.CreateForm(TfrmMain, frmMain);
Application.CreateForm(TfrmSetup, frmSetup);
Application.CreateForm(Tdm, dm);
Application.CreateForm(TfrmNewItems, frmNewItems);
Application.CreateForm(TfrmAbout, frmAbout);
Expand All @@ -55,7 +56,6 @@ begin
Application.CreateForm(TfrmGoToLineNumber, frmGoToLineNumber);
Application.CreateForm(TfrmOptions, frmOptions);
Application.CreateForm(TfrmThemePreview, frmThemePreview);
Application.CreateForm(TfrmSetup, frmSetup);
Application.CreateForm(TfrmDownload, frmDownload);
Application.Run;
end.
Binary file modified Win32/Debug/VisualMASM.exe
Binary file not shown.
Binary file added d7zipv1.2/7z.7z
Binary file not shown.
136 changes: 136 additions & 0 deletions d7zipv1.2/Project1.dof
@@ -0,0 +1,136 @@
[FileVersion]
Version=7.0
[Compiler]
A=8
B=0
C=1
D=1
E=0
F=0
G=1
H=1
I=1
J=0
K=0
L=1
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=1
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
NamespacePrefix=
SymbolDeprecated=1
SymbolLibrary=1
SymbolPlatform=1
UnitLibrary=1
UnitPlatform=1
UnitDeprecated=1
HResultCompat=1
HidingMember=1
HiddenVirtual=1
Garbage=1
BoundsError=1
ZeroNilCompat=1
StringConstTruncated=1
ForLoopVarVarPar=1
TypedConstVarPar=1
AsgToTypedConst=1
CaseLabelRange=1
ForVariable=1
ConstructingAbstract=1
ComparisonFalse=1
ComparisonTrue=1
ComparingSignedUnsigned=1
CombiningSignedUnsigned=1
UnsupportedConstruct=1
FileOpen=1
FileOpenUnitSrc=1
BadGlobalSymbol=1
DuplicateConstructorDestructor=1
InvalidDirective=1
PackageNoLink=1
PackageThreadVar=1
ImplicitImport=1
HPPEMITIgnored=1
NoRetVal=1
UseBeforeDef=1
ForLoopVarUndef=1
UnitNameMismatch=1
NoCFGFileFound=1
MessageDirective=1
ImplicitVariants=1
UnicodeToLocale=1
LocaleToUnicode=1
ImagebaseMultiple=1
SuspiciousTypecast=1
PrivatePropAccessor=1
UnsafeType=0
UnsafeCode=0
UnsafeCast=0
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=
Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;acntD7_R
Conditionals=
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
Launcher=
UseLauncher=0
DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=C:\Program Files\Borland\Delphi7\Bin\
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
14 changes: 14 additions & 0 deletions d7zipv1.2/Project1.dpr
@@ -0,0 +1,14 @@
program Project1;

uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
sevenzip in 'sevenzip.pas';

{$R *.res}

begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
Binary file added d7zipv1.2/Project1.exe
Binary file not shown.
Binary file added d7zipv1.2/Project1.res
Binary file not shown.
56 changes: 56 additions & 0 deletions d7zipv1.2/Unit1.dfm
@@ -0,0 +1,56 @@
object Form1: TForm1
Left = 554
Top = 208
Width = 715
Height = 435
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 56
Top = 112
Width = 75
Height = 25
Caption = 'List'
TabOrder = 0
OnClick = Button1Click
end
object Memo1: TMemo
Left = 56
Top = 152
Width = 497
Height = 209
Lines.Strings = (
'Memo1')
ScrollBars = ssVertical
TabOrder = 1
end
object Button2: TButton
Left = 480
Top = 112
Width = 75
Height = 25
Caption = 'Decompress'
TabOrder = 2
OnClick = Button2Click
end
object ProgressBar1: TProgressBar
Left = 56
Top = 24
Width = 497
Height = 16
TabOrder = 3
end
object OpenDialog1: TOpenDialog
Filter = '*.iso|*.ISO'
Left = 88
Top = 64
end
end

0 comments on commit ca80c22

Please sign in to comment.