Can mt.xe update a manifest embedded in middle (not near the end) of an exe? - manifest

I'm trying to update the manifest included in a Visual FoxPro app with some registry free COM entries. A compiled FoxPro exe appears to contain a VFP runtime along with with some string resources and a default manifest, as well as the pre-compiled app code appended to the end of the exe. When using mt.exe -manifest app.manifest -outputresource:app.exe;#1 the resulting exe is truncated. The manifest is placed at the end of the exe and all the pre-compiled app code is simply removed. Is there a way to update the embedded manifest using mt.exe without removing the app code from the exe, which is normally appended after the manifest?
I've found two alternatives that do NOT work for me. I'm forced to compile the exe with VFP 8, due to code incompatibility with VFP 9.
An article written by Rick Strahl https://www.west-wind.com/wconnect/weblog/ShowEntry.blog?id=890 that assumes the app is compiled using FoxPro 9 SP 2, which isn't an option for me.
A project hook class that assumes the app is compiled in VFP 9 https://www.sweetpotatosoftware.com/blog/index.php/2009/08/03/apply-application-manifest-at-compile-time-with-projecthook/ This is kind of close, but compiling with VFP 9 is not an option for me.
I'm hoping mt.exe provides a better alternative than building my own app to update the manifest in a VFP 8 exe.

Related

Why can't I import a Library in Google Scripts editor?

I've recently created a Google Scripts new Project, called Database. Then, I've used a saved version (version 4) of that script in another project and afterwards dropped (by accident) that version of Database. Now, even if a create a new version, when I open in the menu Resources > Libraries of nthe new project, the Database project appears with the version 4.
screen
When I try to change it and save, the following error appears:
A biblioteca com o identificador Database está ausente. Talvez tenha sido excluída.
(The library with the identifier Database is missing. Maybe it has been excluded).
What can I do now?
You may refer with this post: Library with identifier XXXXXXX is missing (perhaps it was deleted?).
According to the release notes for November 4 2013, a fix for sporadic missing library errors has been rolled out. (Refer to Issue 2817.)
At the same time, a change was introduced such that "If a version of a library has been deleted by the library owner, scripts can no longer use that version." Previously, a script could have been using version 3 of a library, say, even after that version had been deleted. Suddenly, around November 4, that script would have begun failing. The fix in this case is to update the resources used by the script to refer to a still-existing version of the library.
Also as stated in this thread, it seems that there is a problem where sometimes libraries get out of sync. You may need to create new versions for the libraries even though these are in development mode.

Error accessing WinRT sensors in C++ desktop application

I am trying to access the WinRT sensors from a Win32 desktop application using C++/CX as mentioned here: https://software.intel.com/en-us/articles/using-winrt-apis-from-desktop-applications
When I include the C++/CX header file it causes an error when building the Win32 project.
Exact error text: "error C1190: managed targeted code requires a '/clr' option."
Since I am not using /clr code at all, this is a confusing error.
Any suggestions? Please educate me if there is a better way to do this.
The error you are getting is because you are compiling some files without /ZW option for compiler. Since you are able compile at least some files with WinRT extensions, but not others, your project configuration is inconsistent.
The option /ZW (enable WinRT extensions) has to be configured on the level of project (and not on the level of individual files). There are two ways to ensure your settings are consistent. First method is through UI in Visual Studio -- you have to go through all platforms/configurations on the project and ensure /ZW is enabled, then got through all indivudual .cpp files, and ensure they don't override project level settings. This is tedious and error prone. The easier method is to open .vcxproj in notepad and do the following:
Add this section at the beginnig of the file, under root Project node:
<ItemDefinitionGroup>
<ClCompile>
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
</ItemDefinitionGroup>
Search and remove any other places where <CompileAsWinRT> is defined.

Building Windows Store app programmatically

We have a requirement of creating several Windows 8 apps for tablets. There is a common solution and news apps are created by passing different resource to the same code.
For Mobile it was a cakewalk - Used the Microsoft.Build.Evaluation.Project class to get the xap file.
But for Surface, building from code does not give the direct appx output, while building using MSBuild gives appx as the output.
I tried several methods to avoid calling MSBuild from C#(by creating a Command Process) like creating a zip file - myapp.appx - and then signing it using this c++ code. It didn't workout because of an extern reference and I gave up.
Then I tried to use SignTool.exe by creating a Command Process in C#. That too failed.
So, I am wondering if there is any way to build an appx directly from C# without MSBuild.
The reason why I am trying to avoid MSBuild is to get a status from the build process, which Microsoft.Build.Evaluation.Project.Build() provides.
First try adding a pfx key to your project and then try the build via Microsoft.Build.Evaluation.Project.Build() again. The pfx is required from what I read:
See Candy's answer here:
MSBuild target to create the .appx package
So then the trick would be to use SignTool to get the pfx in the first place and update the project with that pfx, but first see if the above works.

Deploy support files from secondary assembly

I'm, porting a phone application written using MVVMCross to Windows RT. The application uses SQLite and has a database that is not empty at deploy so I want it to be packaged in the installation folder anc copied to LacalFolder when the application starts.
The database really belongs to the "Core" assembly shared between phone and WinRT but if I put the file in the Core project (in a custom directory called Data), define it as Content and set the Copy Always flag the file does not get copied to the application installation folder.
If I put the file in a directory under the UI project the file gets copied as expected. Any suggestion to avoid keeping two files for the same resource (and the troubles this will cause) ?
Thanks for help
Windows 8 WinRT projects by default use the Content type which does loose packing of files (they are not included in the assembly). If your Core assembly is part of your solution as a project - VS will properly package it copying all the content to the "Core" subfolder of the appx. If you simply have the dll file referenced in your solution - the resource files will not be packaged. The solution in that case is to do something to get these additional files to deploy with the dll. One option is to package the dll as a .vsix together with the assets as described in Tim Heuer's blog post. Another is to do what you did and put the file in the app project. You can add the file to the app project "As Link" to avoid having a copy of the file - it makes Visual Studio create a sort of logical/symbolic link to the file instead of creating a copy - simply right click a folder in the Solution Explorer/app project, select "Add/Existing Item", browse to the file and instead of hitting the "Add" button - use the dropdown triangle on the button to select "Add As Link".

MySQL T4 Templates Error: Metadata file 'MySql.Data' could not be found

D:\Web\CityV2\App_Code\ActiveRecord.tt(0,0) : error CS0006: Compiling transformation: Metadata file 'MySql.Data' could not be found
Let me start by saying I'm using VWD 2008 Express.
These are the steps I've taken so far:
Created an entirely new project
Added references for Subsonic.Core.dll and MySql.Data.dll
Copied Active Record templates to project
Changed all <## include file="SQLServer.ttinclude" #> to <## include file="MySQL.ttinclude" #>
Copied the MySQL.ttinclude and Settings.ttinclude from the TemplateProviders folder
Updated Settings.ttinclude with my connectionstring and database information
Updated the Settings.ttinclude and created the external tool mapping as per ranomore's instructions
Attempted to build the code from the templates and received the error
I then realized that I didn't have MySql Connector "installed" on my dev box (even though I added a reference to the bin). So I proceeded to MySQL.com and downloaded the latest 6.0.4 connector msi and installed it (GAC). The error no longer appears, but neither does anything else: no new classes, no new errors, nothing [and yes, I refreshed the project after running the command ;-)].
Two things:
Am I missing a step somewhere?
Is there a way build the templates without needing MySQL installed to the GAC?
Unfortunately SubSonic 3 doesn't support VWD 2008 Express (or more specifically VWD doesn't support t4). There is a sort of workaround that ranomore came up with but it will require some work by you. See the following question for more details:
SubSonic ASP.NET MVC sample in Visual Web Developer Express
EDIT: I should have read your question properly you obviously already have the link above. Maybe worth your while downloading the trial of VS professional and seeing if you have more luck with that to see if it's worth outlaying the cash to buy it.
On a side note if you're looking to get an msdn subscription for free you should have a look into registering for the bizspark program