Skip to content

Commit

Permalink
Added manifest file support
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasJaeger committed Oct 1, 2017
1 parent 54912e5 commit 3e73f03
Show file tree
Hide file tree
Showing 26 changed files with 3,032 additions and 674 deletions.
3 changes: 3 additions & 0 deletions Domain/uGroup.pas
Expand Up @@ -125,11 +125,13 @@ function TGroup.CreateNewProject(projectType: TProjectType; options: TVisualMASM
begin
project := CreateProject('Win32App.exe',projectType);
project.CreateProjectFile(DEFAULT_FILE_NAME, options);
project.CreateProjectFile(WIN_MANIFEST_FILENAME, options, pftManifest);
end;
ptWin32Dlg:
begin
project := CreateProject('Win32AppDlg.exe',projectType);
project.CreateProjectFile(DEFAULT_FILE_NAME, options);
project.CreateProjectFile(WIN_MANIFEST_FILENAME, options, pftManifest);
project.CreateProjectFile('', options, pftDLG);
end;
ptWin32Con:
Expand All @@ -141,6 +143,7 @@ function TGroup.CreateNewProject(projectType: TProjectType; options: TVisualMASM
begin
project := CreateProject('Win64App.exe',projectType);
project.CreateProjectFile(DEFAULT_FILE_NAME, options);
project.CreateProjectFile(WIN_MANIFEST_FILENAME, options, pftManifest);
end;
ptDos16COM:
begin
Expand Down
68 changes: 60 additions & 8 deletions Domain/uProject.pas
Expand Up @@ -68,6 +68,7 @@ TProject = class(TVisualMASMFile)
procedure UpdateSavedFunction;
function GetFirstProjectFileByType(pft: TProjectFileType): TProjectFile;
function GetProjectFileWithNoChildrenAndNoParent(pft: TProjectFileType): TProjectFile;
function GetManifest: TProjectFile;
published
procedure DeleteProjectFile(id: string);
procedure AddProjectFile(projectFile: TProjectFile);
Expand Down Expand Up @@ -143,10 +144,25 @@ function TProject.CreateProjectFile(name: string; options: TVisualMASMOptions; f
case FProjectType of
ptWin32:
begin
projectFile := CreateFile(name, fileType);
if fileType = pftASM then
projectFile.Content := TFile.ReadAllText(options.TemplatesFolder+WIN_32_BIT_EXE_MASM32_FILENAME);
AddProjectFile(projectFile);
case fileType of
pftASM:
begin
projectFile := CreateFile(name, fileType);
projectFile.Content := TFile.ReadAllText(options.TemplatesFolder+WIN_32_BIT_DLG_MASM32_FILENAME);
AddProjectFile(projectFile);
end;
pftManifest:
begin
projectFile := CreateFile(name, fileType);
projectFile.Content := TFile.ReadAllText(options.TemplatesFolder+WIN_STUB_MANIFEST_FILENAME);
AddProjectFile(projectFile);
end;
else
begin
projectFile := CreateFile(name, fileType);
AddProjectFile(projectFile);
end;
end;
end;
ptWin32Dlg:
begin
Expand Down Expand Up @@ -178,6 +194,12 @@ function TProject.CreateProjectFile(name: string; options: TVisualMASMOptions; f
AddProjectFile(rcFile);
AddProjectFile(asmFile);
end;
pftManifest:
begin
projectFile := CreateFile(name, fileType);
projectFile.Content := TFile.ReadAllText(options.TemplatesFolder+WIN_STUB_MANIFEST_FILENAME);
AddProjectFile(projectFile);
end;
else
begin
projectFile := CreateFile(name, fileType);
Expand All @@ -194,10 +216,25 @@ function TProject.CreateProjectFile(name: string; options: TVisualMASMOptions; f
end;
ptWin64:
begin
projectFile := CreateFile(name, fileType);
if fileType = pftASM then
projectFile.Content := TFile.ReadAllText(options.TemplatesFolder+WIN_64_BIT_EXE_WINSDK64_FILENAME);
AddProjectFile(projectFile);
case fileType of
pftASM:
begin
projectFile := CreateFile(name, fileType);
projectFile.Content := TFile.ReadAllText(options.TemplatesFolder+WIN_64_BIT_EXE_WINSDK64_FILENAME);
AddProjectFile(projectFile);
end;
pftManifest:
begin
projectFile := CreateFile(name, fileType);
projectFile.Content := TFile.ReadAllText(options.TemplatesFolder+WIN_STUB_MANIFEST_FILENAME);
AddProjectFile(projectFile);
end;
else
begin
projectFile := CreateFile(name, fileType);
AddProjectFile(projectFile);
end;
end;
end;
ptDos16COM:
begin
Expand Down Expand Up @@ -476,4 +513,19 @@ function TProject.GetProjectFileWithNoChildrenAndNoParent(pft: TProjectFileType)
end;
end;

function TProject.GetManifest: TProjectFile;
var
pf: TProjectFile;
begin
result := nil;
for pf in FProjectFiles.Values do
begin
if pf.ProjectFileType = pftManifest then
begin
result := pf;
exit;
end;
end;
end;

end.
2 changes: 2 additions & 0 deletions Domain/uProjectFile.pas
Expand Up @@ -150,6 +150,8 @@ procedure TProjectFile.SetFileName(value: string);
FProjectFileType := pftLib
else if fileExt = '.DEF' then
FProjectFileType := pftDef
else if fileExt = '.XML' then
FProjectFileType := pftManifest
else
// FProjectFileType := pftOther;
FProjectFileType := pftBinary;
Expand Down
5 changes: 4 additions & 1 deletion Domain/uSharedGlobals.pas
Expand Up @@ -76,8 +76,10 @@ interface
WIN_32_BIT_DLL_MASM32_FILENAME: string = 'Win32Dll.asm';
WIN_64_BIT_DLL_MASM32_FILENAME: string = 'Win64Dll.asm';
WIN_16_BIT_DLL_MASM32_FILENAME: string = 'Win16Dll.asm';
WIN_STUB_MANIFEST_FILENAME: string = 'Manifest.xml';
WIN_DLL_DEF_FILENAME: string = 'Dll.def';
WIN_DLL_MODULE_FILENAME: string = 'Module.def';
WIN_MANIFEST_FILENAME: string = 'Manifest.xml';
WIN_16_BIT_EXE_MASM32_FILENAME: string = 'Win16HelloWorld.asm';
LIB_STUB_FILENAME: string = 'LibraryReadMe.txt';
DEFAULT_PROJECTGROUP_NAME: string = 'ProjectGroup1';
Expand Down Expand Up @@ -120,6 +122,7 @@ interface
NEW_ITEM_RC_HEADER: string = '// Created with Visual MASM';
NEW_ITEM_INC_FILE: string = 'Include File';
NEW_ITEM_DEF_FILE: string = 'Module-Definition File';
NEW_ITEM_MANIFEST_FILE: string = 'Manifest File';

ERR_NO_PROJECT_CREATED = 'No project has been created, yet.';

Expand Down Expand Up @@ -215,7 +218,7 @@ TGenericTreeData = record
ptDos16EXE, ptWin16, ptWin16DLL, ptWin32Con, ptWin32Dlg, ptLib);

TProjectFileType = (pftASM, pftRC, pftTXT, pftDLG, pftBAT, pftOther, pftINI,
pftCPP, pftINC, pftBinary, pftLib, pftDef);
pftCPP, pftINC, pftBinary, pftLib, pftDef, pftManifest);

TChange = (fcNone, fcCreate, fcUpdate, fcDelete);

Expand Down
2 changes: 1 addition & 1 deletion Examples/Windows/Examples/SimpleDialog/SimpleDialog.vmg
Expand Up @@ -6,7 +6,7 @@
"Created": "9/15/2017 2:44:32 PM",
"FileName": "C:\\Users\\Thomas\\Documents\\GitHub\\VisualMASM\\Examples\\Windows\\Examples\\SimpleDialog\\SimpleDialog.vmg",
"SelectedProjectId": "EFF2744C-5FE4-4550-8642-1928D832FE64",
"LastFileOpenId": "991F5C45-0C68-4534-A0DE-92D8B5A62DE7",
"LastFileOpenId": "E0F072EA-E175-4951-A35E-59F8F680B106",
"Projects": [
{
"Id": "EFF2744C-5FE4-4550-8642-1928D832FE64",
Expand Down
6 changes: 6 additions & 0 deletions History.txt
@@ -1,3 +1,9 @@
Update - 10-01-2017
-------------------
- Added new Manifest.xml file type to Win32 and Win64 projects. This enables common control look and feel of the
current Windows theme. To add a manifest manually, go to project options and add a new file Other...
The manifest will be included during the resource script compilation if it is present in the project.

Update - 09-30-2017
-------------------
- Minor visual improvements
Expand Down
Binary file added Images/Icons/Manifest.ico
Binary file not shown.
Binary file added Images/Icons/Untergunter-Leaf-Mimes-Text-xml.ico
Binary file not shown.
Binary file added Images/Icons/manifest.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/Icons128x128/manifest.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/Icons24x24/manifest.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/Icons32x32/manifest.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/Icons64x64/Manifest64x64.ico
Binary file not shown.
Binary file added Images/Icons64x64/manifest.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -6,11 +6,11 @@ Create 16-bit, 32-bit and 64-bit Microsoft Windows and 16-bit MS-DOS application
![visualmasm0](https://user-images.githubusercontent.com/1396719/28137590-d82dee0e-671b-11e7-8f03-84b82cd18d87.png)
![visualmasm0](https://user-images.githubusercontent.com/1396719/28137589-d82d453a-671b-11e7-8ec4-48a8bacc2cc9.png)

Update - 09-30-2017
Update - 10-01-2017
-------------------
- Minor visual improvements
- Improved visual form designer to correctly calculate dialog units from pixels when producing .RC
(resource script) files. Now forms and controls are correctly layed out.
- Added new Manifest.xml file type to Win32 and Win64 projects. This enables common control look and feel of the
current Windows theme. To add a manifest manually, go to project options and add a new file Other...
The manifest will be included during the resource script compilation if it is present in the project.

To try out the latest build
---------------------------
Expand Down
Binary file modified Setup/VisualMASMSetup.exe
Binary file not shown.
1 change: 1 addition & 0 deletions Setup/vmsetup.iss
Expand Up @@ -176,6 +176,7 @@ Source: "..\Win32\Debug\templates\Win16Dll.asm"; DestDir: "{app}\Templates"; Fla
Source: "..\Win32\Debug\templates\Dll.def"; DestDir: "{app}\Templates"; Flags: ignoreversion
Source: "..\Win32\Debug\templates\Win16HelloWorld.asm"; DestDir: "{app}\Templates"; Flags: ignoreversion
Source: "..\Win32\Debug\templates\Win32HelloWorldDialog.asm"; DestDir: "{app}\Templates"; Flags: ignoreversion
Source: "..\Win32\Debug\templates\Manifest.xml"; DestDir: "{app}\Templates"; Flags: ignoreversion

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Expand Down
Binary file modified Win32/Debug/VisualMASM.exe
Binary file not shown.
16 changes: 0 additions & 16 deletions Win32/Debug/manifest.xml

This file was deleted.

10 changes: 10 additions & 0 deletions Win32/Debug/templates/manifest.xml
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<description />
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>

10 changes: 10 additions & 0 deletions templates/manifest.xml
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<description />
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>

0 comments on commit 3e73f03

Please sign in to comment.