Setup/MSI - Multiple user input directories - visual-studio-2010

I'm in need of a setup creation tool (preferably outputing MSI file but not necessary) that is able to prompt the user for a "core" installation directory, and then prompt a second time for a "runfile" directory.
I've messed around a bit in Visual Studio 2010 and with Inno Setup but can't seem to find a solution.
Any suggestions?

A list with the best tools available currently: http://en.wikipedia.org/wiki/Windows_Installer#Tools

Related

Force extension installation in Visual Studio

We're working in quite a large project and is having a hard time getting people to configure their Visual Studio correct (tabs instead of spaces etc.). We found a great solution in using the EditorConfig extension for Visual Studio.
However there are still some developers that seems to ignore our request to install this extension to their Visual Studio and hence I'm wondering if there is any way to force an extension to be installed before a solution can be opened, maybe some setting in the .sln file?
No there is no such option built-in. If your machines are domain joined, you could push out the installer through System Center or domain logon scripts.
You could cheat and create a solution level pre-build step. Create a target file named: before.{solutionname.sln}.targets and store it next to your solution file. Check it into source control. In the targets file you can use standard MsBuild to see if the extension is installed (you'll need to check the file system probably) and if not present force the installation by calling vsixinstaller.exe to trigger the install.

Visual Studio 2013 Installer Projects Extension copying to root folder

I have installed Microsoft Visual Studio 2013 Installer Projects to create a simple installer. When I run the installer however it copies the files to c:\ instead of the proper folder in Program Files (even though it asks for the path).
This seems to be caused by the fact that the MSI (the only thing produced by the Installer project) is not run with elevated privileges. The other thing is that you cannot say run as administrator for MSI file (unless you do some reg-hacks).
I have searched for a solution and there seem to be loads of more or less complicated ways how to tackle this.
The question is - is there not a simple switch that would allow me just to copy the files to appropriate Program files folder? I do not want to create workarounds for something that seems to be the very basic functionality.
If adjusting the environment (UAC settings, Registry values) is totally not an option for you then maybe you could try one of the following:
The Visual Studio Setup Project produces both an MSI and a setup.exe file. The latter one you can run as administrator by right-clicking on it. No hacks.
Another way of starting a process with elevated privileges is opening a command prompt (cmd) as administrator and then launch your EXE or MSI from the command prompt window.
-
Note: Even though it may not be related to your question, I would also pay attention to the Target Platform. For instance, you cannot install a 64-bit project to the Program Files (x86) folder.

add own path to the targetpath during installation

I want to attach my own folder name to the "DefaultLocation" during msi installation (using VS 2005). Currently all programs installs at "C:\Program Files (x86)". I want to append some "xyz" path to the installation path during installation. So, once the user clicks next, the path for the installation should be "C:\Program Files (x86)\xyz".
Can anyone tell me how to do this in the windows installer.
The short answer is no, because here is nothing in Visual Studio setup projects to support that. You'd need the ability to change the target directory in the UI sequence after that dialog, that's what's missing.
VS setup projects are limited in their support for all the features of Windows Installer, so migrating to a different tool would be useful if this is the kind of customization you're looking for.
Could anyone tell you how to do this in Windows Installer? Technically yes. You'd need somebody who knows enough about the insides of MSI files generated by VS to design a solution (a custom action based off the Next button?) and change the MSI file manually to do it, and how to repeat that after every build (a post build script), and for you or your company to understand enough to fix it if it stops working. That doesn't seem practical compared to just using a tool that will let you do it. My apologies for the editorial but if VS doesn't support it your choices are limited.

How can I make Qt addin VS2010 store paths to Qt versions per system (not user)?

I'm working on a project with Qt using the Visual Studio Addin in VS2010 Professional. Two branches of the project use two different Qt versions (4.8.4 and 5.0.2) so I have both versions of the addin installed (1.1.11 and 1.2.1). I'm also actively developing using at least two computers, both Windows 7, for which I have a networked, roaming user profile. I don't know the specifics of how this user account or network is setup.
Qt is installed in different locations on each system. If I set the correct paths in the Addin on one system (System A), it changes them for the other system (System B) and then complains to me that Qt doesn't exist at that directory when I later log into System B. Is there a way to save the paths to Qt versions on the system, without it affecting the paths on the other system? Or will I have to just deal with changing them each time I change computers?
EDIT:
I from looking through the source for the visual studio add-in, I found that these settings are saved as user registry values. I don't know much about Windows roaming profiles but I'm now assuming that user registry values are copied between computers just as their files are. I don't know if there's any way to move these registry values somewhere else without having to edit and recompile the add-in. I suppose the only other thing I could do is write a startup script to edit these settings upon login.
EDIT: Make sure visual studio on each computer can find the right add-in and the right environment variables on the computer you are using.
http://qt-project.org/wiki/QtVSAddin
In this documentation it talks about where it gets installed to:
"%USERPROFILE%\Documents\Visual Studio 2008\Addins"
So you could manually change the location of the addin, to some local system path.
How to -> Visual Studio Add In Manager
Or you could change the qt path that the Add-in refers to every time you log in, or right before opening visual studio.
Setting a system environment variable from a Windows batch file?
I would use version control to just get the files that you need for the project, and exclude/ignore all the environment specific elements of the project.
One way you could achieve this is:
To install Bazaar. Create a standalone tree of the code on a shared drive or on a location on the harddrive that both users have access to.
Do an initial add of all your source and header files and your qt .pro file.
Checkout or branch the code to user specific folders. In those user specific folders, let Visual Studio create all the user specific, Qt Add-on specific, (etc) files.
Also create a .bzrignore file with files and folders like these listed:
Debug
Release
x64
*.ncb
*.suo
*.user
*.vssscc
*.scc
*.vspscc
*.lnk
*.bak
*.aps
*.pro.user
object_script.*
Makefile
Makefile.Release
Makefile.Debug
Then when you want to try your build for each setup, finish your edits, commit/push your changes on the user that did the edits, and update/pull on the user that wants the changes.
Although the version control may be a little tricky to get started with, it will make project collaboration both scalable, trackable, and very manageable!
And you aren't limited to Bazaar. Check this wiki out if you need ideas.
http://en.wikipedia.org/wiki/Comparison_of_revision_control_software
Another way that you could try to go about doing this, is to have all the source code in some path (either absolute or relatively up from your projects locations), or on the computer, and have the project folders reference those paths in the project folders, but have two separate project folders. This would not be nearly as elegant, but would work.
C:/path/to/vs_proj1
C:/path/to/vs_proj2
C:/path/other/proj/source
And in the properties for vs_proj1, and vs_proj2, in the part about locating source files, have ../other/proj/source to find it relatively, or put the absolute path C:/path/other/proj/source.
Also two other things to be aware of when sharing projects over a drive like this, is that when you are referencing libraries, you may want to store that information in a user specific macro file in Visual Studio and reference the macro in your project settings.
Visual Studio - Where to define custom path macros?
And while I'm here, you may need to #define some things in your program to allow for behavior for one version of Qt that isn't in the other.
So for example, in the source of your program, you might have:
#if QT_VERSION < 0x050000
// some Qt 4.x specific stuff, not in Qt 5
#else
// some Qt 5 specific stuff, not in Qt 4.x
#endif
Hope that helps.

VS2010 Create installer with multiple directories

I have been looking for ages and I can't find any good examples of how to edit the standard installer for visual studio 2010. I need to create an installer that allows the user to specify 3 folder directories to install files into. Once the 3 folders are specified and the files are installed I need to write the directory locations in to an INI file.
Any tips or tutorial links would be great thanks!
This is not supported by Visual Studio. It can be done only with other setup authoring tools.
If you want a free solution, you can try WiX. It has a steep learning curve, but it gets the job done.

Resources