Visual Studio Installer how to prompt for install of shortcuts - installation

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.

Related

How to publish Windows Forms Control Library with Visual Studio 2022

I believe this is a question for beginners and I apologize if it was not asked in a right way. I use Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.2.2
The steps I take are:
In the Start Window that asks me "What would you like to do?" I select Create a new project. This takes me to a new window "Create a new project".
In the search field(Search for templates (Alt+S)) I enter "Windows Forms Control" and choose first result. The first result for me is: "C# Windows Forms Control Library(.NET Framework) A project for creating controls to use in Windows Forms(WinForms) applications". and then I click Next.
I click Create because for this question a name or anything else is not something that I have changed. That means(for me) that "Place solution and project in the same directory" is unchecked and that I use .NET Framework 4.7.2
After the project is opened I go to the Build option in the menu and look for the "Publish Solution" option but there is none.
Questions:
Is it possible to publish this(Windows Forms Control Library with Visual Studio 2022) or I just use .dll when I am finished ?
If it is not possible to publish or it is not possible to create some kind of executable file from Windows Forms Control Library why I am able to drag and drop controls like buttons and text fields and with that create some kind of UI?
If it is possible to publish please tell me how?
Is there some kind of list what we can publish or not when using visual studio?
Additional explanation: I followed this: https://learn.microsoft.com/en-us/visualstudio/designers/walkthrough-windows-forms-designer?view=vs-2022 and then at the end of this article there is a "Next steps" part where it says:
This article has demonstrated how to construct the user interface for
a simple calculator. To continue, you can extend its functionality by
implementing the calculator logic, then publish the app using
ClickOnce. Or, continue on to a different tutorial where you create a
picture viewer using Windows Forms.
And I followed the article that is behind the link "publish the app using ClickOnce" and tried to publish.
After some research(more than one try...) I have decided to ask a question here...
Thanks for your time in advance.

Visual Studio Community Won't Load Default Files

I'm trying to learn C++ and when I opened a new win32 console project it just gave me an empty project when it should have gave gave me like stdafx.h or the name.cpp file. Any way to fix this?
Did you try updating your workloads? After installing VS, if you didn't choose the right workloads to load certain types of projects such as Win32 console projects, go into your programs folder from the control panel and right click on Visual Studio. Choose 'change', not 'uninstall'. The page you are given is your workloads. Read them and decide which one supports that type of program. Check that workload, then in the right sidebar you will see custom options. Not all the ones you need may be automatically checked. Make sure any that refer to the build process are checked. Then click to proceed and VS will install the updates.
For Win32 programs, you need to add the workload called "Desktop development with C++" and then on the Installation Details pane on the right check all boxes that mention a "build".

Visually Editting AXML file in VS2010

My VS2010 won't allow me to visually edit AXML files. I want to configure the "Open With..." feature in VS to run the visual editor.
The "Open With" feature is available by right-clicking a file in the solution.
Another one of my VS installations has this feature so I know it's possible. There must be something in the Xamarin install that this feature doesn't get setup some times.
Does anyone know how to set this up manually via the "Open With..." selection dialog?
Right now, I switch back and forth between Mono Develop and VS...what a pain...
This should not be the case you should just be able to select the file from the Resources/Layout folder and have the option of either the Source/Design view. If you are unable to do this just use the Xamarin Studio as you have been doing but it might also be a idea to use the DroidDraw website www.droiddraw.org/ in order to have a GUI to design your interfaces.
Hope this helps,
James

Visual Studio 2010 addin /Projects with GUI

I'm trying to figure out how to do a VS2010 add in with gui, (like a simple popup with a few fields and an enter button)
I found stuff on stack that says Visual Studio (2010?) projects is what I need (instead of an addin) but all the tutorials I can find are for VS2008, and dont' apply to vs2010.
Is the answer outdated? what do I use?
Can anyone tell me what technology I need to use?
We have some powershell scripts that take parameters and generate code for us, I want to click on a menu item under tools (or a tool bar button) popup and ask for the parameter values, click ok, and then run the powershell. (someone else wrote the powershell, i just want to creat a built in gui for them)
As a bonus I'd like to add resultant files to the projects, but that's down the line.
Any hint or tutorials you can point me towards would be a great boon.

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