VC++2005: Automating the build for 32 AND 64 Bit - visual-studio-2005

I'm using MS Visual C++ and have to deliver a 32 and 64 bit version of the same project in one installer. That's error-prone of course, I might forget to update one, so I want to automate the build process. But the "dependencies" work only between different projects.
Is there a way to have one build trigger (e.g. of the 32 bit version) a second one (e.g. the 64 bit version and as post-build step the installer)?
Thanks!

It's considered to be bad practice to build deliveries from within an IDE. Rather, consider using a CI server. This way, after writing a build script, you'll never forget to do anything.

You could use a command line build using a batch file to trigger both builds using a command line invocation of devenv.exe as part of the installer build?

Related

Add custom xml lines to project

I’m generating projects for unix and windows with cmake. For win we use certain version of vs build tools, which are a bit outdated already. As a result each time I launch generated project, I get project upgrade prompt, which is quite useless.
I’ve found that thread on how to disable it via certain oneliner:
<VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>
The question is how do I insert it into project during cmage gen process.

How to invoke (MSYS git) bash reliably from VisualStudio / MSBuild

I am working on a project where most of the work is done in Visual Studio 2012, implicitly using MSBuild. However I have to integrate a few unixy tools, and I even have a few bash scripts. This is possible, because we are already using msysgit; the tools and scripts work just fine
if you invoke them from the git-bash shell. But I want to run some of them from MSBuild as pre/post build actions.
The problem is how does MSBuild find bash? We assume it exists, but developers simply install it on their PC's in different locations, and will rarely add it to their %PATH%. I want a solution that involves a minimum of per-PC configuration. Ideally none at all.
I think the easiest way is to define a sensible default for your MsBuild solution and let it be overriden by developers on an as needed basis. Asking for bash or git to be on %PATH% is a reasonable default hence you could describe it as such
<PropertyGroup>
<BashCommand Condition="'$(BashCommand)' == ''">bash</BashCommand>
</PropertyGroup>
This way any developer who wanted to override the setting could do so by defining the value before importing the core MsBuild files
On the assumption that you are talking about the user installation (which we typically call Git for Windows) -- as opposed to the developer installation allowing you to develop Git for Windows itself (which we actually call msysGit) -- then you should be able to simply assume that Git is installed either in %ProgramFiles% or in %ProgramFiles(x86)%. You could even add a third option, say, %GitForWindows% which the users could set if they installed it elsewhere.
If that is not good enough, I am certain that the InnoSetup installer (or Windows' Installed Software management) leaves some trace in the registry, although that might be a little fragile: you would depend on that registry key not changing, ever.

Qt quick deploy, empty window on running

I have a problem with launching application after deploy.
Build project, did copy all necesary files in release folder, the move it on another machine (if is important, I built it with MinGW 4.8 32 bits on Windows 8 64 bits and tried to run it on Windows XP 32 bits). However, when I tried to run it, it just shows a small white square.I tried to use Qt Resource System. Created a .qrc file, here it is:
<RCC>
<qresource prefix="/">
<file>qml/Rename_Files/Button.qml</file>
<file>qml/Rename_Files/main.qml</file>
<file>images/file_browser_icon_32x32.png</file>
<file>images/file_renamer_icon_32x32.png</file>
</qresource>
and used resources accordingly:
viewer.setSource(QUrl("qrc:/qml//Rename_Files/main.qml"));
"qrc:/images/file_browser_icon_32x32.png" & "qrc:/images/file_renamer_icon_32x32.png"
On build machine everything works.Now copy again everything on the other machine and try again. No change at all!
Any idea how to solve it?
Not being able to load an image at runtime in a deployment machine is usually a runtime plugin error. If it can't find the appropriate imageformat dll, it won't load the image.
Create a folder called "imageformats" next to your exe and put the appropriate dll's in there to use all the image formats you are using in your program.
Find the dll's on your development machine in
<Qt Install Dir>\<Compiler>\plugins\imageformats
http://qt-project.org/doc/qt-5.0/qtcore/qcoreapplication.html#libraryPaths
http://qt-project.org/doc/qt-4.8/deployment-windows.html#qt-plugins
So you probably need qico.dll.
If the above doesn't solve your problem, you may need to run "depends.exe" on your development machine to see if there are other dlls you need. Also you can do some additional debugging on your development machine to do runtime checks to make sure it can find the image:
Qt Label::setPixmap not working
Hope that helps.
I solve my problem. This thread http://www.qtcentre.org/threads/56250-Empty-window-when-running-application-on-Windows-XP-32-bits?highlight=empty+window contains what I found through my research and Chris' help.
I apologise for very late response.

how should I go about replicating VS2010's Publish command?

I'm trying to build a publish script that doesn't use VS2010 -- I want it to be automated and in powershell (may use Psake soon). The biggest issue that I run into is that a project that will build and publish fine in VS2010 will either not build or not publish via the msbuild command. The closest I can get is (anonymized code):
msbuild /p:OutDir=c:\temp\publish\staging\myProj\myProj_1481\;Configuration=Debug;UseWPP_CopyWebApplication=True;PipelineDependsOnBuild=False C:\TEMP\export\myProj\1481\src\myProj.com\myProj.csproj
That one is failing for a Could not find file error in one of the DLLs. Naturally it publishes fine from VS2010. Is there some sort of recursion that I need to do? I'm burning up quite a bit of time on this one particular portion of my script -- the one part I have the least control over.
Requirements:
if the proj will build in VS2010 I shouldn't need to modify the csproj file -- I don't want to hand this script off to someone else and have them stick in "fix your csproj" land for hours per project
have to be able to script it entirely at the command line
hopefully no additional installs needed
Related:
Trying to Build and Publish Asp.net website from command line using aspnet_compiler (old)
_CopyWebApplication with web.config transformations (didn't fix my issue)

Recommended .NET app installer?

I need to create an install for my app that executes the following actions:
Copies files
Writes registry settings
Registers a windows service
Writes an XML app.config file (based on user supplied info during install--a connection string)
Executes SQL scripts against a remote database (connection info obtained in #4)
Installs and registers a COM dll
Adds entry to Control Panel>Add/Remove programs for uninstall
I don't need any fancy logic to allow the user to customize these steps--I can hard-code them with user-supplied info injected where appropriate.
I looked at Wix but found the documentation and examples don't line up well with recent releases.
I also looked at NSIS but found support for writing XML to be too limited (the plugin for this can only handle strings up to 64 bytes).
I initially brushed off the VS2005 built in Setup project as incapable of handling these tasks but I'm ready to reconsider after stumbling with what I thought were better options.
Any suggestions?
I would still recommend looking into WiX a bit more. We use it to do everything but #6 on that list and while there is a small learning curve. We've been using WiX v3 for almost 3 years, and I haven't found too many places where the docs/tutorial is that far out of place. And usually where it is its because they cleaned up the syntax and made it better.
Also, as of the next release of Visual Studio (2010/Rosario) WiX is being build directly into Visual Studio, I'm not sure if in parallel with the current Setup Projects or replacing them completely.
A Visual Studio Installer project can do whatever custom code you want; wouldn't see why any of your requirements would be a problem.
I have used Visual Studio (2005) and Wise and can recommend both. You didn't mention if the tool had to be free, and if so that rules out Wise. Nevertheless Wise has a dead easy learning curve and is very powerful and well documented. I have had a few weird things happen to me with Visual Studio. One time I had to delete my project and start over (possibly due to stupidity on my part - never figured it out), but overall I have been using it for a couple years at my current job and it works for me.
You can use just Visual Studio and Windows without commercial tools to achieve what you need.
First, check out the answer to create a single installer file.
Then, you can research how to create a Custom Action class that can perform registry, read/write files and register COM dll's separately.

Resources