Installshield Limited in Visual Studio 2012 Professional

Microsoft decided to drop the ability to create simple setup installers in 2012 but they worked with Flexera to allow us to use Installshield Limited to create our installers.

Below are the step required to create a simple installer.  It should give you an idea how to create an installer for your VS 2012 program.

Notes:

  1. First, you need to make sure that all DevExpress libraries (and other custom references) in your program are set to CopyLocal — this will have the build system copy the libraries to binDebug (or binRelease) so you can include them in the InstallShield project.  Also be sure to build your app before creating the installer.
  2. Second, I’ve been creating entirely new solutions for each installer in a separate directory.  This eliminates the problems 2012 has with opening the old installer types (and may prevent future problems with bundling).  It also makes the build process much faster on the program you are creating.

Creating a new installer:

  1. Create a new InstallShield Limited Edition project for the installer (in ProjectsVB.NetInstallers)
  2. Application Information
    1. Set the default installation location if you don’t want the program to be installed in Program Files
      1. In the Application Information sidebar, click Edit the default installation location
      2. Right-click Destination Computer (or press INS key) and choose New Directory; name it C:
      3. Right-click the new C: directory (or press INS key) and choose New Directory; name it YourSubFolder (obviously change it and repeat as necessary to create your desired directory structure)
      4. Right-click new YourSubFolder directory (or press INS key) and choose New Directory; use the name of your project
    2. Specify company name: YourCompanyName
    3. Specify application name: YourAppName
    4. Specify application version: YourAppVersion
    5. Specify company website: YourWebsite
    6. Change the icon to your project’s icon (if desired)
  3. Installation Requirements
    1. App does not require specific operating system
    2. App requires .Net 4.0 Client Profile (but I do not include it in the installer — see Problems below).
  4. Application Files
    1. Click on the C:YourSubFolderYourAppName folder.
    2. Press Add Files button and go to your App’s bin/Debug (or bin/Release) folder and add all exe/dll/config files.
  5. Application Shortcuts
    1. Modify the name of the Start Menu shortcut  (if desired)
  6. Application Registry
    1. Add registry keys if your App requires them.  Use the INS key to add new keys and values (or right-click)
  7. Installation Interview
    1. Do not display License Agreement
    2. Do not prompt for Company/User name
    3. Allow modification of installation location
    4. Do not launch application when the install completes
  8. Organize Your Setup, General Information
    1. Set Use Software Identification Tag to No.
  9. Prepare for Release, Release
    1. Click on “Express” and set Setup File Name to YourAppName Setup
  1. Right-click on the Solution and choose Properties
    1. In Configuration Properties/Configuration, set your project to SingleImage.
  2. Build the project
  3. Verify the project installer name
    1. In Prepare for Release, Release, Builds/Express/SingleImage/Disk Image(s)/DISK1: check file name

Problems:

  1. I have not yet been able to include the .Net packages in the installer.  The downloads from within the Installshield project always fails.  Update: you have to run Visual Studio as Administrator (right-click, “Run as Administrator”) in order for the installer packages to download.  This should be a one-time thing; just run as admin once to download all of the redist files you need and then open your project normally (without admin) to work on your project.
  2. I had to disable Use Software Identification Tag or it would give me an error upon building.  The installer creates correctly without it and will install the project with no problems.  When I get some more time I’ll look into this further.

Uppercase menus in Visual Studio 2012

One of the changes in Visual Studio 2012 that has drawn the most complains is the forced uppercase of the menus. You can suppress that with the following registry tweak:

  1. Open the registry editor and go to the following key:
HKCUSoftwareMicrosoftVisualStudio11.0General (for 2012 Pro)
HKCUSoftwareMicrosoftVSWinExpress11.0General (for Win8 Express)
HKCUSoftwareMicrosoftWDExpress11.0General (for Desktop Express)
HKCUSoftwareMicrosoftVSWDExpress11.0General for Web Express)
  1. Create a new DWORD value called SuppressUppercaseConversion set to 1
  2. Restart Visual Studio and you should see the change

Reference: http://blogs.msdn.com/b/zainnab/archive/2012/06/14/turn-off-the-uppercase-menu-in-visual-studio-2012.aspx

VB.Net: Targeting .Net 2.0 using VS2008

I’ve switched to Visual Studio 2008 a while back; it seems more stable than 2005 and I just seem to get projects done faster in the newer version.

However, 2008 by default uses .Net 3.5 and most of my computers are still at 2.0 version. I’ve been very careful to target new projects at 2.0 but when I go to install them, it still requires the installation of 3.5 — that was quite annoying. However, I’ve found the fix.

When you create new projects in 2008, be sure to target them to 2.0 in the Create Project dialog. When you add the Setup project, also be sure to set it to 2.0. Now you’d think that’s all you have to do create a 2.0 project in VS2008, but you’d be wrong! 🙂

To check your project, double-click “My Project” in Solution Explorer, select the Compile tab and click the Advanced Compile Options…” button at the bottom. Now, you’ll see the Target framework at the bottom of the next dialog; make sure it is set to .NET Framework 2.0.

Now, to check your setup project, double-click the Microsoft .NET Framework entry under the Detected Dependencies in Solution Explorer. That will open up the Launch Conditions tab. You should see the .Net Framework under the Launch Conditions folder; click on it and then look at your Properties window. Under the Version property, you’d expect to see 2.0 but it is set to 3.5 — that’s why the Setup msi requires .Net 3.5 instead of using the existing 2.0 framework. Simply change the Version to 2.0, recompile the project and setup project, and you are good to go at 2.0!

You’d think that targeting the setup project should update the Launch Conditions; maybe it’s just a bug. 🙂

UPDATE: The above fixes the MSI installer, but if you try to use the setup program, it will try to install .Net 3.5! There is yet one more place to change: right-click on your setup project is Solution Explorer and select properties. Press the Prerequisites and unselect .Net 3.5 and select .Net 2.0.

VB.Net: Disappearing text in textboxes

Several of my projects contain multiline textboxes with scrollbars, and when you mouse over the textbox in Vista/2008 the text will disappear. This is a known issue from VB.Net 2005 (and it still occurs in 2008):

VS Feedback: Multiline text box problems

There is no fix available for it yet, but there are two workarounds:

  1. Change the border style to None or Fixed Single, or
  2. Parent the textbox in a new panel that does not have a transparent background.

Hard to believe that this hasn’t been fixed in VS.Net 2008, but maybe it’s a .Net issue instead of VS.