Create msi installer using visual studio installer - visual-studio-2013

I tried to create a MSI installer for a simple windows project with basic set up. When I ran the built msi file it is not installing anything in the target location neither creating a desktop icon. Though I can find an entry in control panel. I am using VS 2013, not able to understand why it is not creating anything.
Thanks for help.

You should say what you actually did. It won't install anything to the target system unless you put files (or project output) in the Application Folder in the setup project, and it won't create a desktop shortcut unless you right-click the executable in the Application Folder view, create shortcut, then drag and drop the shortcut to the Desktop folder, again this is in the setup project's File System view.
Start here, old but still they way they work:
https://www.simple-talk.com/dotnet/visual-studio/getting-started-with-setup-projects/

Related

How do I compile a UWP application to a stand-alone EXE file?

I have a UWP application. I can run it inside of Visual Studio by using the Run button. I also know how to create an App Package and distributed it via App Center.
What I can't figure out how to do is build an EXE file that I can run on my own computer without launching Visual Studio (or copy to another computer). I found the EXE in the project folder under bin/x64/Debug (or bin/x64/Release), but it won't run. In fact it does nothing when I double-click on it.
What am I doing wrong?
The easiest way I have found to get apps installed on computers for non-technical users is to give them the output of that Create App Packages submenu, which includes a ps1 script and certificate file. If you give it to them as a zip make sure they unzip the whole folder first, and run the ps1 script from the unzipped folder. If Developer Mode is not enabled on their computer, the settings dialog to enable it will open automatically, and they just have to flip the switch. Otherwise, they are just pressing Y or A in the PowerShell window to continue through the installation process.
It's not too bad, the whole thing takes about 30 seconds if you breeze through it, but I believe you need admin rights on the computer you're installing on, there's a UAC prompt at some point.
I found the EXE in the project folder under bin/x64/Debug (or bin/x64/Release)
The exe file is the uwp executive core, but it could not run directly, because it has some dependencies need to be packed together, so we need use Visual Studio to create package for your app. And this document contains detailed steps you could refer.
After getting the installation package, we need the side-load, and please note:
If you are not publishing your app and simply want to sideload an app package, you first need to trust the package. To trust the package, the certificate must be installed on the user's device.

Qt5VSAddin for Visual Studio 2013 - where are the Settings saved to? And/or how to disable addin?

I'm working with Visual Studio 2013 professional and Qt 5, so I installed Qt5VSAddin, which is working as intended (I can choose an installed Qt version; meta compiling etc is working; Creating new VS Qt project works like a charm).
However I would like to use the same project and solution files on different machines, where Qt isn't necessarily installed in the same directory.
At the moment, the Qt addin changes the content of the project's .vcxproj.user file and adds the line <QTDIR>directorypath</QTDIR> with "directorypath" being the path I've chosen in QT5->"Qt options"->"Qt versions" of the addin. So if I compile on that machine, QTDIR in the .user is changed to that machine's Qt installation directory, meaning that I'll destroy the project file for anyone else trying to compile the project on another machine (maybe someone without the addin).
What I want to do is to change this Qt version information to a path relative to an environmental variable, like <QTDIR>$(MY_QTDIR)</QTDIR> or <QTDIR>$(MY_DEV_ENVIRONMENT)/Qt/</QTDIR>. Unfortunately, Qt5VSAddin does not allow to create QT versions with environmental variables (at least not with $() syntax) because it does not let you click on the "OK" button in this case.
I tried to change it in the .vcxproj.user file direcly, which does work (I can compile the project this way on another machine without the addin), but on VS2013 restart or clean->build it will overwrite the changes again.
I tried to deactivate the Qt5VSAddin in extras->add-in-manager (unchecked all 3 boxes) but after VS restart, the addin is active again. How can I deactivate it completely without uninstalling (I would still like to create new Qt projects with the addin occasionally)
Is there a way to set the Qt version path of the Qt5VSAddin including an environmental variable?
If not from the GUI, maybe I can change it directly in some config file? unfortunately I couldn't find the file/location where the addin configuration parameters are placed. So where are those pathes and settings saved to?!?
Addin stores its settings and Qt paths in registry: HKCU\Software\Digia\Qt5VS2013\ and HKCU\Software\Digia\Versions\ accordingly.
I didn't find yet where those settings are placed.
I tried to create a fantasy-named-folder and search for that foldername within all files on my drive, but didn't find it...
However I found the reason why I could not deactivate the Qt5 addin in Visual Studio for longer than the current session:
Visual Studio has to be started as Administrator to change the Addin options (at least for the Qt5 Addin) persistently!
After deactivating the addin, everything works as I like it.
I'm still interested in finding and manipulating the Qt-Versions pathes of the addin, since accessing the new project->Qt5 Projects templates, without re-activating the addin, results in a broken/incomplete project. So to get a working new Qt project, atm I have to restart VS as admin, activate the addin and create the project there (followed by manually editing ther .user file and deactivating the addin as admin again)...
UPDATE: Unchecking only the "start" addin option as an admin, I can activate the addin for non-admins on-the-fly to create a new project. I think I will be able to work this way, however I'm still interested in the second question.

Creating msi in vs08 - few questions

I am creating an MSI from inside visual studio 2008.
This is what I am doing:
(With the project I am creating this for open in Visual Studio) right click Add new project
Setup and Deployment > Setup Project
Give it a name
Right click Application Folder > Add > Project Output: Primary Output
Question: does this contain all I need to run the project?
I want to create the .msi to put a shortcut to it on the Users desktop, so
Create shortcut to Primary output from Project
Move this to the users desktop folder
Question: how do I get this to keep the icon from the project!! conveniently doing this seems to have lost the app icon and picked some random generic one instead.
Thanks,
edit 0: Oh and also, can I set so when running the .msi the user cannot change where it is installed to?
Nobody knows how to do this?
It should unless you are referencing mixed mode assemblies in which case you may have to manually add files to the installer as the dependency resolution is very poor in this case.
You need to set the icon manually in the properties of the setup project.
To Remove the option to select the installation folder try opening the user interface view of the project and deleting the 'Installation Folder' screen.

Visual Studio: How to protect file from removal on uninstall

Folks,
I am creating an installer project in Visual Studio. This is done using a project of type "Setup and Deployment".
I lay out the file structure of my final install in the "File System" View of the project.
Now, some of the files I create as part of my install are updated while my application is used. I would like these files to not be removed during an uninstall of my application. Is there any way in Visual Studio to designate a file as "protected from uninstall"?
Thanks for your help.
In the Solution Explorer window, in the Setup project, click the file. Then in the Properties window, set the Permanent property to True.
I'm not sure how to do it in the installer, but any file that you create from the application will be preserved in the event of an uninstall.
If you can stand it, maybe you could create these files as a first-time initialization in your application.
Of course, this can lead to other problems (permissions to create a file), but it might be easier than fighting with the cryptic installer setup.

Installation of demo project - best practices

Using Windows Installer (targeting XP and Vista), is there a best practice for installing demo projects and files with your application?
From experience installing on Vista/XP I would recommend...
1, Install the source code/project/solution files into the 'Users' directory for Vista. That way when the user opens up the demo and compiles they have write access for generating the output files. If you put the files into the 'Program Files' directory under Vista you do not have write access and so the compile will just fail.
2, Add a shortcut to the solution to either the desktop or the start menu so that the user can then get access to it without having to know the exact location. Under Vista/XP when you install into the 'Users'/'Documents and Settings' directory it is not easy to find the installed files because they are placed inside a directory that is not shown unless you select 'Show Hidden Files' in file explorer.
3, I would recommend you sign the installer using your publisher certificate so that when the user gets a UAC dialog on Vista they can see the name of the publiser and be more likely to continue with the process.
4, At the moment the split between Visual Studio 2005/2008 is about 50%/50% and so make sure you provide both versions of the project/solutions files. Alternatively just supply the VS2005 files and let the user upgrade using the wizard in VS2008.

Resources