VS 2010 Setup Project show form conditionally - winforms

I'm creating a setup for my application. The application consists of a main application and an AddIn to Outlook. I wish, that the user is able to select by checkbox, if Outlook AddIn should be installed.
My problem is, I don't want to show/enable that checkbox if outlook is not installed.
How can I achieve this? Can I somehow show install dialog conditionally, base on some code, where I would check if Outlook is installed? Or can I disable this checkbox base on some code?
Please help,
thanks a lot!
Greetings

First, to identify if Outlook is installed you need to define a search in the MSI package.
Then, to show a dialog based on a condition you need to edit the published events for a couple of buttons (Back and Next) from the surrounding dialogs.
To show a control conditionally on a dialog you need to use a control condition.
All of this is not possible to do in a VS Setup Project. I would recommend switching to WiX (http://wix.sourceforge.net/) if you are looking for an a better free alternative, this can integrate with VS too. I would switch from VS Setup project and because Microsoft decided to stop including it in VS 2012, so then you will be forced to stop using it.
If you don't want to go to WiX right now, the only way to do what you need in VS is to add a post-build event that alters the MSI tables and inserts the changes you want, i.e. the search, control condition, etc...

Related

DataSource controls not available in .NET Windows Forms app using Visual Studio 2019

I am running Visual Studio Community 2019 version 16.11.3, and I am having a problem with the data source controls (both SqlDataSource and ObjectDataSource).
Neither control shows up in the Data tab of the toolbox, yet when I use the "Choose Items..." option they are both checked. I have gone so far as to uncheck them, save the changes and then came back in and re-checked them, but that didn't work either. Even if I use the "Show All" option they don't show. Can anyone shed some light on this?
I have tried the suggestions from other posts, including resetting the toolbox, adding a custom tab, and then resetting again, but nothing seems to work. I even switched to an older version of the framework (4.6) to see if this might be the issue, but nothing works.
Any suggestions?
According to Jim's comment, I compiled the answer.Just for helpling others to solve a similar issue.
SqlDataSource and ObjectDataSource are used in ASP.Net, not Windows Forms.
Generate a source of data using whatever means necessary, whenever needed.
Use Visual Studio's Tools to handle a Project data source, through the Designer. -- Note that this object doesn't have any connection to a View, it doesn't need to handle states.
To have a functionality similar to what you're probably used to, you also need a DataAdapter (working with DataTables) or a similar connector provided by an ORM. -- A BindingSource only handles notifications that are generated by the objects it's bound to and doesn't offer any data update feature.

Failed to load toolbox item in VIsual Studio in WinForms C++

I am creating a windows form application in managed C++. To add a custom user control either one can create a new project or add CLR User control to same project. When I add a user control to same project it builds and shows control in toolbar. When I drag and drop it onto my main UI it throws up error.
"Failed to load toolbox item, It will be removed from Toolbox".
There is no error if I create a separate project under same solution and compile control as a DLL. Is there a way I can add a custom user control to same project and use it.
Also I looked up similar question on the topc but none of them has helped me. I have checked the files and I am building the project as Win32 and there is no way control being separately built as x64.
Had same problem after one or both of renaming project or/and changing platform, most posted "solutions" provided to other people asking the same question didn't seem to work.
What did work for me was to go into the project folder and delete the obj folder, and just to be safe the bin folder too, then build again. (Seems the so called Build->Clean menu item only does half of the required work.)

Customize Setup Project Dialogs

Using VS2010 - I have a winforms project that I needed to make an installer for, I have that all done and it works great. But there's a lot of files in the Setup project I created and customizing all of the dialogs in the Unser Interface will be a huge pain. Because I think I have to build each time I want to test/preview it, which takes a loooong time.
Is there a simpler way to edit and customize these User Interface dialogs? I don't need to do anything too fancy. Hopefully something like, "Make a quick change, preview it, make another change, preview it, etc."
Thanks!
If you want to custom the User Interface Dialog, you can try InstallSheild. In vs2013, Microsoft use the InstallSheild Limited Edition instead of the the default setup project in vs2010.

Any way to add custom code activities to VS toolbox for any workflow project?

What I would like to achieve is to have 2 tabs with custom code activities added automatically to the toolbox every time a new activity is created in any (workflow) project. Ideally this should be done through some code or installer.
I found a solution using the Visual Studio Integration Package but that one is not suitable for me (as it needs the SDK).
I have also tried using the IActivityToolboxService interface but that worked only for creating the tabs in the toolbox. And I was able to create them only if I (already) had access in toolbox to my custom activities.
Any other ideas are highly appreciated.

Why do my toolbox items disappear in Visual Studio 2008?

I'm working on a solution that contains multiple projects targeting Windows Mobile 5 and standard Windows applications.
Lately when opening up a form in designer the common UI controls (textbox, button, label, etc etc...) have vanished leaving only the controls defined within the project.
Resetting the toolbox has no effect. A google search suggested deleting the toolbox temp files in the Local Settings\Application Data\Microsoft\VisualStudio\9.0, however this was only successful in bringing back the default controls for Windows Mobile 5. The WinForms controls are still mysteriously missing.
Also, if I right-click and Select All on the toolbox, all of the WinForms controls do in fact come up, however they're all grayed out.
Has anyone else experienced this?
I just had a similiar problem. In a managed C++ project all the default toolbox items disappeared form the winforms designer. After playing around for a while I found that there was a problem in the .vcproj file.
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="COLLADA Import"
ProjectGUID="{0DEEF9B6-1929-44E3-92EC-13712839FB63}"
RootNamespace="COLLADAImport"
Keyword="ManagedCProj"
TargetFrameworkVersion="0"
>
When you set TargetFrameworkVersion to a valid number, for example 131072 for .Net 2.0, the toolbox items will be back.
If you right click on the Toolbox and select 'Choose Items...' and then sort by the 'Namespace' column, you can then select the ones you need (for example System.Windows.Forms for WinForms).
You can multiselect with Shift and then select/deselect the group.
The controls then reappear in the Toolbox as enabled.
I've noticed this exact same thing for regular WinForms as well. I can't speak to mobile applications but in regular winforms this has a tendency to happen.
I believe it's actually a bug in Visual Studio.
There are some things you can do (again, for WinForms. I'm not sure about mobile) with adding attributes to your control. Such as:
[ToolboxBitmap(typeof(MyControl), "MyControlBitmap")]
There are some other useful related things on this site:
http://en.csharp-online.net/Design-Time_Integration-Attributes
I had exactly the same problem (after installing Windows Mobile SDK all items in the toolbox were greyed out).
I've startet the Visual Studio 2008 command line as administrator and started the following command (WARNING - all your settings are lost !!)
devenv /setup /resetuserdata /selfreg /resetskippkgs
After that the toolbox looked fine and worked like on the first day.
The idea came from this thread: connect.microsoft.com
Go to the Tools menu and choose import & export settings, then choose the 'reset all' setting, then yes. Save your current settings, after that you'll have your toolbox reappear.
Actually you may be able to add a registry key to get this to work also.
Make sure you're not in Debug mode.
If you are running Visual Studio 2008 under vista, try running it as an Administrator. Right click on the shortcut and select Run as Administrator.
Well guess what install Service pack 1 for VS 2008 and it would go away and if you have wireless mouse and keyboard turn it off. Choose one of these two both work.

Resources