Shortcuts created by Setup project in Visual Studio - visual-studio

I was working with a legacy project and need help with some shortcuts created, the problem is that those shortcuts appear to be non-standard because when you right click on them and in the target location only shows the name of the program grayed out.
I have seen those shortcuts before and had no problems. The current problem is that when running on Windows XP you can the icon and get the run as different user, but in windows 7 that functionality is limited apparently only to the shortcuts that point explicitly to an "exe" file.
The final users need that functionality due to some policies and the current work around is to them create the shortcut manually. I need a way to create a standard shortcut via the setup project.
Thanks in advance

Related

Visual Studio 2017 - Open in Visual Studio from Explorer - Permission Error

I am using VS 2017 Enterprise.
I have it setup to open/run in Administrator mode which is working for SLN files.
However I'm trying out the new "Open in Visual Studio" feature by right clicking on a folder in Explorer. I'm receiving the following permission error. It's happening for every folder I try.
VS Code has no problem however.
Is there something more I need to enable?
My first guess would be that the VS 2017 application itself (devenv.exe) is configured on that machine to always Run as Administrator see https://technet.microsoft.com/en-us/library/ff431742.aspx on how to change it:
To mark an application to always run as an administrator, do the following:
1. On the Start menu, locate the program that you want to always run as an administrator.
2. Right-click the application’s shortcut, and then click Properties.
3. In the Properties dialog box, click the Compatibility tab.
4. Do one of the following:
- To apply the setting to the currently logged-on user, select the Run This Program As An Administrator check box, and then click OK.
- To apply the setting to all users on the computer and regardless of which shortcut is used to start the application, click Change Setting For All Users to display the Properties dialog box for the application’s .exe file, select the Run This Program As An Administrator check box, and then click OK twice.
See also list of things that you can't do without administrator account https://msdn.microsoft.com/en-us/library/jj662724.aspx. What typically makes Web-developers to make VS always run as administrator is "Deploying a web application to Internet Information Services (IIS) on a local computer." and "Debugging applications that a run under a different user account, such as ASP.NET websites."
For me it has worked as it should, at least this can help you.
First question is how you "setup to open/run in Administrator mode" ?
Using the "Advanced button" of the Visual Studio 2017 shortcut is not enough because methods with the right mouse button don't use this shortcut.
Using the method of the compatibility tab as mentioned already by SergGr
(https://technet.microsoft.com/en-us/library/ff431742.aspx) has worked for me, and I have been able to use it for folders as well as for solution files !
I am logged in as a member of the local admin group and UAC standard setting into Win 8.1 .
Another possibility instead of using the compatibility page would be to inject an own manifest into devenv.exe. Neither of the two is very clean (I am no fan of the whole compat layer, but it helps here a bit).
Have you tried to switch UAC off temporarily for a test? Or how you have configured UAC?
If you have done it the way described, the explorer should come up with a correct UAC message.
This works for me if not for you then refer to (https://marketplace.visualstudio.com/items?itemName=GregTrevellick.OpeninVisualStudio2017Enterprise):
1. open notepad.exe and paste this into it:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
#="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""
here is my registry file exported just incase you need it (you shouldnt):
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
#=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,56,00,53,00,20,\
00,43,00,6f,00,64,00,65,00,5c,00,43,00,6f,00,64,00,65,00,2e,00,65,00,78,00,\
65,00,22,00,20,00,22,00,25,00,31,00,22,00,00,00
2. save as VSElevated.reg
3. go to where you saved the .reg file and double click, yes to everything and ok.
4. This is how your Registry should look like afterwards:
The reason i think is the %1 is missing in your launch command. This should solve it.

Visual Studio 2013 - Open .aspx and .cs files from other project at the current project

Probably it's a stupid question but i would like to open aspx and cs files from the windows explorer without opening a new instance of visual studio, is this possible?
Greets,
Firmino
There are several ways you can improve your experience opening files in VS.
You can use drag and drop
Troubleshooting: You can't drag and drop between apps in Windows if one of them is running with admin rights and another is not. Normally, you don't need either of Explorer or VS to run with admin privileges.
Visual studio running with no admin rights will most likely will be reused to open a file when you doubleclick in the Explorer (sometimes it still opens new instance with no sensible reason)
You can use File_Menu->Open->File (Ctrl+O). This will basically open an Explorer instance for you.
You can use File_Menu->Recent files if you have opened desired file recently
You can just add file to the project (and then get rid of it when it's no longer needed) (Shift+Alt+A)
You can use Show All Files feature (a toggle button in Solution Explorer) to view all the files under project folder (recursively), even if they are not included in the project. You cannot see folders higher in hierarchy, but you could make for example a symlink or just a dumb copy
You can file a feature request or a bug report (it can be done from VS itself) to make developers know about this situation
Hope any of those solutions will work for you.
Right Click On The File
Click Open With
And Select Notepad..
It Would Do The JOB

How can I edit command-line args in shortcuts generated by InstallShield?

Sometimes when an installer installs a program, and creates shortcuts, for some reason they aren't "normal" shortcuts. They have the Target textbox and Open File Location button greyed out, like such:
I'm using InstallShield 2011 LE (Limited Edition) for Visual Studio 2010. It works as advertised, but I don't see any options to change the way it creates shortcuts. The program I'm installing would greatly benefit from adding command line arguments to that Target textbox. If I go find the executable in Program Files, and Send To -> Desktop (create shortcut), I (and my users) can modify that one, no problem. I don't want to have to make them go through this step, though.
How are shortcuts placed by an installer different from "normal" shortcuts?
In InstallShield, set the Advertise property to "no".

Visual Studio Installer how to prompt for install of shortcuts

I am using the basic VS project of Other Project Types\Setup and Deployment\Visual Studio Installer\ Setup Project.
I want to give the user the option of whether or not to create a desktop shortcut to the application. I know how to create a desktop shortcut, but not to make it optional. So far I have not made any custom dialogs for the install, just using the standard interface that VS provided automatically.
Is there any way to provide the user the choice without getting into a whole bunch of customization?
Are many people using this installer? I look around, we have a 5 year old license to InstallShield, but I have also found it to be bulky and more than we need for this application.
I also looked at WiX, but I don't have the time to learn an install package right now and it looks like a fair learning curve on it.
Basically our install has .NET 4.0 requirements, installs SQL Server CE, a couple other DLL's which are just copied in and populates a structure. I am not using the registry, using the preferred resources approach for that, so it is a very straightforward install.
There several ways to do it, in general… But I don't know the particular steps for Visual Studio installer project.
Create a feature which contains the Desktop shortcut. If you have feature selection tree in your installer, present this feature as yet anther option.
With another approach, you'll have to customize one of the existing dialogs or add a new one where you can show a checkbox. The checkbox changes the value of a property which, in its turn, controls the installation of component or feature for Desktop shortcut.
Yet I guess this method is not supported by Visual Studio.
See Microsoft UX guidelines on putting shortcuts on Desktop.
In most cases, it is not necessary to put a shortcut on Desktop unless your target users start your application very often.
The general approach is this:
create a custom dialog which contains a control that can condition the shortcut, for example a checkbox
create a custom action which deletes the shortcut after install
condition it with the checkbox property
This can be done in Visual Studio:
select your setup project in Solution Explorer
click User Interface Editor button on top pane in Solution Explorer
add a Checkboxes dialog under Install -> Start
customize it to contain only a checkbox that conditions your shortcut
add your shortcut deletion custom action in Custom Actions Editor page
condition it with the checkbox property
Some commercial setup authoring tools have this feature built-in.

How to clear User's Programs Menu folder?

I am trying to create an setup project in visual studio 2010 that clears an existing applications program menu. After running the installer that I am creating, the installer duplicated already existing short cuts in the programs menu. I would like to be able to remove all the existing short cuts from a specific programs menu folder and just have the new short cuts appear.
Right click on Deployment project, select properties and set the "RemovePreviousVersion" property to true..

Resources