Change default Windows installer location in Visual Studio - windows

I'm modifying a Windows installer in Visual Studio 2008 (Visual Basic I believe, what my company's currently using) and I want to change the default install "Folder" of the program (the name of the directory). I've attached an image
to show what I mean. "Folder" defaults to "C:\Program Files (x86)\foo\" and I want it to default to "C:\Program Files (x86)\bar\" instead every time the installer is run. I feel like I've gone through just about every menu/item in the install directory and everywhere I can find, done my online research, all to no avail. Any help with this or in what window/menu to look in would be very-much appreciated. Thanks!

In the File System view in the setup project, select Application Folder and then use F4 (or right-click=>Properties window). That will show you the default location. The values in square brackets are Windows Installer properties, the rest are your text.
If you want to get more up to date Visual Studio Community Edition is free and there is an installer project add-on for it that you can get from the Visual Studio extension gallery.

Related

How to rename Visual Studio

I just downloaded Visual Studio and the name is showing like this "Visual Studio Community 2017 (2)". Everything is working but that "2" at the end is just annoying. And of course first thing I've tried was reinstalling. Anyone can help me with this? Thanks in advance.
Screenshot of how it looks
And by the way my computer is completely new and I've never had Visual Studio installed on this computer.
The issue is that the instance of visual studio has a nickname associated with it. Use the following instructions to change the nickname of an existing Visual Studio (tested with VS2017) installation (partially lifted from https://developercommunity.visualstudio.com/content/problem/99059/not-able-to-easiliy-change-installation-nickname.html):
Set the nickname in the *.isolation.ini files in
%ProgramFiles(x86)%\Microsoft Visual
Studio\2017\[Version]\Common7\IDE.
Set the nickname in the state.json file in
%ProgramData%\Microsoft\VisualStudio\Packages\_Instances\[InstanceId]\state.json
Open regedit, go to under path
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall, find there "Visual Studio {your version} 2017 (2)". Rename string to be without " (2)" - this will change application name appearance in control panel / program and features.
You'll need admin permission to modify these files. If you want to remove the nickname altogether, just set it to an empty string (e.g. Nickname= in the .ini files, "nickname": "" in the .json).
Note that this will only have affect within VS tools, such as the VS installer in the screenshot you posted. Any names with the suffix in, for example, the Start/Windows menu will need to be renamed manually.
If you don't want to mess up with any files on you file system, one alternative is to reinstall the product.
After you uninstall the annoying product with the nickname "(2)", you can select the Installation locations tab and specify another nickname or perhaps leave it blank. Mine does not allow to leave it blank.
Here is a screen:
If the installer says that a nickname is mandatory, even after uninstalling Visual Studio (like in the screenshot by Bernardo above), you can try the InstallCleanup.exe tool by Microsoft. You can find it in your Visual Studio Installer folder.
After running this tool with the -i flag, I was able to re-install Visual Studio 2019 without a nickname.
Link to InstallCleanup.exe docs
A nickname is mandatory for the Visual Studio installation when you are installing the same version of Visual Studio(eg.: VS 2019 or 2022) but with different editions(eg.: VS Community or Professional or Enterprise).
If we uninstall the same version of VS with different edition, then the VS Installer is not asking for the nickname and not taking the nickname as 2, the "Installation nickname" textbox is not visible under Installation locations tab in VS Installer.

Console Application not found on visual studio 2015

I just download visual studio community to my pc. When i opened the vs-2015 and create new Console application project. i can't find it any where under the c# we installed templates or any templates.
Thinking about to uninstall and install again but this not the first time i uninstall and install this, i did installed and uninstall few time but still can't find the web Console Application template.
Thank you.
I had the same problem and found the solution on another site. Here are the steps that need to be performed:
Open a Visual Studio command window with admin privileges. This can be done from Windows search after clicking on the Windows button (or Start button - depending on the OS) located in the lower left corner. Make sure that you don't have any Visual Studio project open before proceeding.
Type in prompt in the search box and select "Developer Command Prompt". Right click on this and select run with admin privileges.
In the command window Enter:
cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
In the command window then enter:
devenv /installvstemplates
This worked for me and I was able to create a new console project after this.
With my version of VS 2015 community edition, upon install there was a Console Application (Package) template available, which I mistakenly thought was a Console Application template. This is not the case. It is a web console application project and I only discovered this after trying to access the File and Directory classes in System.IO from my code. The compiler kept on complaining:
Error CS0234 The type or namespace name 'Directory' does not exist in the namespace 'System.IO' (are you missing an assembly reference?)
MyProject.DNX Core 5.0 ...
It still complained after putting in a reference to System.IO and even after changing the offending line of code to:
string DataPath = System.IO.Directory.GetCurrentDirectory();
A big clue here is the reference to DNX Core 5.0, which is an optimized run-time for ASP apps. It was at that point that I discovered that the Console Application (Package) template was also listed under the New Project window Templates / Visual C# / Web.
So, For others that may happen to find this post and think you are using a standard Console Application template, but have errors like "CS0234 The type or namespace "name" does not exist in the namespace..." then you could be using a Console Application (Package) template - which is probably not what you want and should be replaced by a regular Console Application. If you don't see it in the New Project window under Templates / Visual C#, then you should follow the steps above to install it.
EDIT
This is what my New Project window looks like after I performed the steps above:
Comparing this window with yours above, it appears to be somewhat different. Notice that "New Project" on my window is centered and for yours it is not. Also, at the bottom of the window yours has only Name, Location and Solution name, while my window adds a fourth item called Solution.
So, first thing, try clicking on Visual C# located in the left pane of your New Project window to see the templates available. Post that snapshot here. This can be done by selecting edit.
If you still don't see the Console Application template, then perhaps you downloaded a different version of Visual Studio 2015 than I did. So, here is the screen that pops up after selecting Help / About Microsoft Visual Studio on my system:
Compare this screen with yours and post a snapshot of your screen here. Also, what operating system are you using?
Thanks again Bob for your time to explained it to me, i am really appreciate that, I uninstalled and installed again from this link enter link description here, On my machine i have Visual Studio 2015(this one works) and Blend for Visual Studio 2015 is still missing template but i don't care it anymore if it work or not because i will use the one that works which is the Visual Studio 2015.

Visual Studio 2015 Find in Files not remembering file types or locations

I rely on the Find in Files dialog in Visual Studio a great deal. (Sometimes Intellisense/Resharper just don't cut it.) Since upgrading to 2015, I've noticed that the dialog doesn't remember my custom "Look in" paths or "Look at these file types" lists between sessions.
If I close my solution and VS instance, then reopen, I have to enter my custom path and file types again. Huge waste of time. Has anyone run else run into this? Any workaround? 2013 used to remember this stuff.
Microsoft Visual Studio Professional 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.00081
Installed Version: Professional
I've never had any problems with it not remembering my settings, but I imagine that you could run a custom registry modifier to add the appropriate keys, you could make sure your settings are always pristine. The custom search information is stored in HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\Find.
The file types are stored in a string key called Filter with whatever you would normally input into the custom file type category in the VS search window. For example searching for only .cs and .txt files you would put *.cs;*.txt.
The folders are located in a string key called Query with values such as C:\Folder1;C:\Folder2. However, it's behavior seems a little weird. You have change the value of Query and a Query+integer value (i.e. Query0) to the same value to have it appear in Visual Studio.
If you just run a script to modify the above values to the files types/folder locations you want, that should work.
I ran into this today. After much searching I found a post on the visual studio forums somehow. This pointed me towards ReSharper. This directed me towards a workaround.
Start visual studio in safe mode with the command line argument /SafeMode
Create the folder sets you want for searching
Restart visual studio not in safemode
Once I had restarted all my created custom searches remained, and the registry values were created. This might not work in the specific case, but this worked for me.
You can set these values programmatically inside Visual Studio for the Find and Replace dialog (for example with Visual Commander):
DTE.Find.FilesOfType = "*.txt";
DTE.Find.SearchPath = #"c:\temp";
If you have an earlier version of VS, export the environment settings, copy the NumberOfScopes and NamedScopes* settings from the Environment_UnifiedFind section to the same section in your VS2015 settings file and then re-import settings.
Once I did this, it allowed VS2015 to start saving folder specifications for future settings exports.
Or you could try replacing this in your VS2015 export:
<PropertyValue name="NumberOfScopes">0</PropertyValue>
With this:
<PropertyValue name="NumberOfScopes">1</PropertyValue>
<PropertyValue name="NamedScopes>0">FOLDER_SPEC_NAME>SEMICOLON_SEPARATED_LIST_OF_FOLDERS>{4A812F3C-7B1A-4987-9769-461F20EB25CB}</PropertyValue>
(Don't forget to re-import after you make the change)

How to create a new Visual Studio solution on the desktop using the context menu?

Years ago, using VS2005, I had a setup where I could right-click on the desktop/folder, select New, select Visual Studio 2005 solution and it would create a solution for me right there. I can't remember how I did this.
Does something like this exist for VS2008 or VS2010? It would be really handy.
EDIT: Figured it out based on the links in the answers (and also found an old email to myself).
1. Create a registry file (.reg) with the following content, then execute it:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.sln\ShellNew]
"FileName"="Visual Studio Solution.sln"
2. Create a new file called Visual Studio Solution.sln in C:\Windows\ShellNew folder with the following content:
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
3. Reboot Windows and you'll have yourself a context menu.
I used to use what I think you are looking for. It was done with a little registry update (.reg) file whose contents start like this
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.sln\ShellNew]
"Data"=hex:EF,BB,BF,D,A,4D,
of which this is just a snippet, and it was for an earlier version of VS. But this might be enough to jog your memory, or give you something to google for. See here for more
http://flux88.com/2009/03/right-click-new-visual-studio-solution/
edit..
also see http://visualstudiohacks.com/registry-hacks/create-solutions-without-folders/
I believe the Team Foundation Server edition of Visual Studio does that, either stand alone or with the Team Foundation Server Power Tools, which the Power Tools site says it has Windows Shell Extensions.
Also Codeplex hosts MSBuildShellExtension which is a little off topic for what your looking for, but its nice because it lets you build your project from any directory on your hard drive, without ever having to launch Visual Studio.
1) In Visual Studio 2010, use the "Blank Solution" project to create a solution.
2) Copy that SLN file into "%SystemRoot%\ShellNew".
3) In RegEdit, go to HKEY_CLASSES_ROOT.sln
4) If a key (folder) for "ShellNew" does not yet exist under .sln, create it.
5) Create a string value under ".sln" with a name of "Filename" and the filename of the SLN file for its data.
Done. No restart necessary.
REF: http://support.microsoft.com/kb/140333

Error while installing Microsoft visual studio Professional 2010

I am trying to install Microsoft visual studio Professional 2010 on my Windows XP SP3 edition. I am getting the error "vs_setup.msi could not be open" :
I have seen some forums mentioning the same problem for different reasons, and mostly because of having a previous version of Microsoft visual studio installed, but this is the first time for me to install it. Any idea how to fix that ?
Note: The actual setup files are in the path "G:\Visual Studio 2010 Professional". I do not know why the setup is trying to look for vs_setup.msi inside the "G:" directly ! Of course it is not there.
Maybe this setup is from DVD image and it's hardcoded to work in root directory.
Try to move all setup files to G:\ or another drive root
It probably doesn't like the spaces in the installation folder name. Rename "Visual Studio 2010 Professional" to VS2010Pro and see if it doesn't start working.
Also look for the setup log in %temp%. Sometimes it's cryptic but you can usually get SOME idea of what went wrong. Maybe edit your question with the errors from that log. It's called dd_something*something* etc.
Microsoft Visual Studio 2010 Shell (Isolated) Redistributable Package.
With 7zip open and extract VSIsoShell.exe in a New Directory (there are many files inside of this .exe).
After this is done, redirect to the right path w/ the extracted files (with vs_setup.msi file).
7zip is an Open source Windows utility for manipulating archives (www.7-zip.org)

Resources