Tuesday, June 30, 2015

Office 2016 Preview now available!

Office 2016 Preview is now available!  You can download the Office 2016 Preview (either 32-bit or 64-bit) release from here: https://products.office.com/en-gb/office-2016-preview

If you want a direct link to be able to download the 32-bit release of Office 2016, you can download it from here: https://products.office.com/en-us/office-2016-preview?WT.z_clid=O16_Home

Copying and pasting highlighted/selected text from Test Output window

If you use TestContext.WriteLine or Console.WriteLine to output text to the Test Output window, unfortunately, the only operation you can perform for text in the Test Output window is right-clicking and selecting "Copy All"

If, instead, you want to select or highlight a portion of text from the Test Output window, you are out of luck.  You are forced to perform a "Copy All" operation and paste it into a Text Editor and then highlight and copy out the text that you actually need.


If you find this functionality a bit annoying and wish that Microsoft would allow highlighting and selecting text to copy from the Test Output window, you should vote for this UserVoice item here: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/8631334-provide-ability-to-select-specific-text-to-copy-fr

Accepting QueryString parameters in ASP.NET Web API

I was recently working on a project that wanted to send a complex serialized object to ASP.NET Web API.

Unfortunately, when you pass the serialized string to ASP.NET Web API in a RESTful manner, you get a 404 because ASP.NET Web API does not understand the RESTful Url.

However, there is a simple workaround to doing that and that is to specify the [FromUri] parameter for the ASP.NET Web API method as is outlined in this article: http://www.asp.net/web-api/overview/formats-and-model-binding/parameter-binding-in-aspnet-web-api
 
If you are using a primitive data type as the QueryString parameter, all of these will work:
 
http://localhost:1874/api/values?authToken=B205545C63D14E0BB17A30C05A92A120



http://localhost:1874/api/values?AuthToken=B205545C63D14E0BB17A30C05A92A120


However, the parameter name MUST MATCH the method signature!!

 



public string Get([FromUri]string authToken)
{
   return authToken;
}

If you have a method signature like this instead:

 



public string Get([FromUri]string myToken)
{
    return myToken;
}

ASP.NET Web API will INSTEAD return the DEFAULT Get method instead of the intended Get method:

 



public IEnumerable<string> Get()
{
    return new string[] { "value1", "value2" };
}

Once I did this, I was able to successfully pass the object in the Query String of the Url to ASP.NET Web API and everything worked beautifully!!

Saturday, June 27, 2015

Installing Windows Features via PowerShell without an Internet connection

As many Windows Server Administrators already know, if you want to install additional Windows Server Features, this usually requires access to the Internet.

Unfortunately, if you do not have access to the Internet, you cannot use the standard Install-WindowsFeature command to install Windows Server Features.

Fortunately, Microsoft offers the ability to install features directly from the source media via the -Source parameter such as this: -Source D:\sources\sxs

You can read more about how to use this parameter in conjunction with the Install-WindowsFeature PowerShell command here: https://technet.microsoft.com/en-us/library/jj205467%28v=wps.630%29.aspx

InstallShield vs. Advanced Installer Head-to-Head Feature Comparison

 Two of the major contenders in the installation packaging space are InstallShield and Advanced Installer.

Overall, if you compare the 2 solutions side-by-side for features and functionality, Advanced Installer would win by a landslide since it supports many more project types than InstallShield as well as numerous features for rapid development of installation packages.  This, coupled with the fact that Advanced Installer releases updates nearly every month, makes Advanced Installer the clear winner.

Therefore, this feature comparison between the 2 products is really about overall usability and ability to quickly and easily develop installation packages.  Since there are far too many features to cover in a single Blog Post, I will cover the major features and functionality needed to deploy an ASP.NET Web Application.

XML Files



InstallShield handles XML Files much differently than Advanced Installer.  It provides a completely separate screen for managing XML Files.  This requires specifying the final destination path through the use of properties, thus segregating the view of the XML File from the actual target destination in the Files and Folders view.  You can either construct new XML Files or Import existing XML files.  The way the elements and text are matched for existing text files is very poorly handled overall since it is largely based on existing text in the XML file to perform appropriate matches.  Problems with XML File handling in InstallShield has been plaguing InstallShield for years and years and it does not seem to have improved significantly even in the most release of InstallShield (InstallShield 2014).



Advanced Installer provides significantly better functionality in handling XML files by directly integrating this functionality into the Files and Folders view.  As you can tell from the above screenshots, the handling of XML files is much cleaner in how the elements and attributes are displayed.  Even though the Import XML Dialog does not provide a built-in file extension filter for *.config files, Advanced Installer still recognizes .config files and handles them appropriately through its XML feature.

IIS Web Site/Application Creation



InstallShield does not offer much in the way of IIS management.  InstallShield allows you to create a new web site or create a scan of an existing Web Site and import its configuration.  However, InstallShield is completely lacking in terms of providing dialogs for handling user selection of IIS websites.  Instead, the user is expected to completely handle this functionality on their own.








Advanced Installer is significantly better in handling IIS creation and management by not only offering the ability to use existing websites such as the Default Web Site, but also providing a nice easy-to-use Wizard to create a Browse IIS Dialog that can be used to provide user input for IIS Website selection.

SQL Database Scripts







In this instance, InstallShield really, really shines.  SQL Database handling provides a very nice dialog to browse for SQL Server instances and databases as well as provides an easy way to manage SQL Connections and adding and importing SQL Scripts.  InstallShield even provides validation capabilities for versions of SQL Server to ensure that the installation package only installs on supported versions of the database platform.  




Advanced Installer does not really offer much in the way of SQL Database handling.  The built-in Dialog capabilities provide the ability to browse SQL Server instances and SQL Server databases, but does not offer the unified look and feel of the dialog provided by InstallShield nor does Advanced Installer provide the additional database platform validation capabilities provided by InstallShield.

Files and Folder Handling



InstallShield really fails on usability in the area of Files and Folder management.  In order to set up Dynamic File Links, one has to go into the Components view and set up Dynamic File Linking.  These capabilities are not available directly from the Files and Folders view in InstallShield.



Advanced Installer provides an easy and intuitive way to support dynamic file linking through a feature they call "Synchronized Folders".  Fortunately, this is configured directly through the Properties dialog in the Files and Folders view rather than having to go into Components view to manage this.

Dialogs and Themes




InstallShield has not really changed or updated their dialog capabilities at least for the last 6 years or so.  The Dialog Themes that have been there since at least InstallShield 2008 are still there today in InstallShield 2014.  The one nice feature for Dialog management in InstallShield is the ability to Clone Dialogs.  Other than that, however, managing Dialogs and sequencing for Dialogs is a complete nightmare in InstallShield.    Any break in the sequencing of controls in an InstallShield Dialog can completely destroy and ruin an installation package.  In addition, the sequencing of Dialogs is handled on the Custom Actions and Sequences section of InstallShield, thus requiring the developer to move from the Dialogs section to the Custom Actions and Sequences section just to see the final/eventual order of the Dialogs.  



Advanced Installer, while it lacks the ability to Clone Dialogs, is overall much more user friendly and once again excels in having a unified interface.  Dialog sequencing can be done directly from the Dialogs view through Drag and Drop operations and each of the Themes provide numerous accompanying styles to choose from as well as thoroughly modernized styles to match the latest themes shipped with Visual Studio over the past few years.

Custom Actions



InstallShield lumps together Custom Actions with the Custom Actions and Sequences section, so the interface looks quite cluttered.  However, the display of the various colorful icons for the various icons makes it relatively easy to identify the different types of Custom Actions that have been configured.  There are also limitations to some of the Custom Actions such as the PowerShell Custom Action which does not support the passing of parameters to the PowerShell Custom Action.  


Advanced Installer takes a much simpler approach to managing Custom Actions by putting Custom Actions into User Friendly terminology that identifies what types of tasks the developer wants to perform rather than simply providing a list of all of the various types of Custom Actions that are available.  This makes it easier to choose a Custom Action to perform any necessary operations required for the installation package.

Property Management


InstallShield provides a very nice Grid for managing all of the Properties.  However, choosing properties throughout most of the IDE is a largely manual process.  If any of the properties or mistyped or misspelled, obviously, the properties will not work as part of the package.




If you are creating Custom Properties, then you will need to add Install Parameters:

Unfortunately, this aspect of Advanced Installer is pretty primitive compared to what is offered by InstallShield, however, while lacking the pretty Grid for managing and editing properties, Advanced Installer is much more functional overall throughout the IDE.  The Advanced Installer IDE provides Intellisense and property picking throughout the entire IDE thereby making it easy to choose and find existing properties to use throughout the installation project resulting in a more reliable final installation package.  

Prerequisites


InstallShield provides a very long list of Redistributables/Prerequisites for downloading and including the project, but provides no standardized groupings for the prerequisites thereby forcing the developer to search and filter through the list for the appropriate prerequisite to include as part of the installation package. 


Advanced Installer once again excels in the management of Prerequisites by grouping the various prerequisites into logical, standardized groupings for .NET Framework, Database, Internet Explorer etc.

Launch Conditions


InstallShield provides a very limited set of Launch Conditions for the installation package:

Advanced Installer does a much better job of providing a whole array of launch conditions to choose from including items like system memory and display resolution:



Wizards

 InstallShield offers a very convenient feature in that it allows you to easily browse back and forth between the Installation Designer view and the Project Assistant/Wizard view:


While Advanced Installer does not offer the same capability, the initial wizard that it provides is much more functional for deploying certain types of applications such as ASP.NET Web Applications:
















Virtual Machine Deployment

InstallShield introduced VM deployment with InstallShield 2014 and offered a rather nice way of managing it:


When I tried setting up the VM Profiles in Advanced Installer (v. 12.2), I was not even able to edit the VM Profiles since I was working with Advanced Installer directly within a VM :



NOTE: Advanced Installer support notified me that this currently only works when Advanced Installer is installed on a physical host machine rather than within a Guest OS.

Path Variables

InstallShield has a nice grid for managing Path Variables similar to what is provided for the Property Manager:



Advanced Installer does not offer as nice of an interface for managing Path Variables and the detection of Path Variables tends to be much more unreliable than InstallShield in this regard:


Build Automation

In this area, InstallShield blows away Advanced Installer hands down.  InstallShield offers a very feature-rich COM-based API that lets you access and manipulate nearly every aspect/facet of the installation project as well as a standalone build installation package that can be used specially for deploying to Build Servers.

Advanced Installer, while recently offering plugins to Continuous Integration servers such as Jetbrains TeamCity, is still largely a very command-line driven application and numerous areas of automating Advanced Installer are not available or are very poorly documented.

Automatic Updates

InstallShield offers the ability to include automatic updates for your installation package but requires you to purchase Flexnet Connect which is a very pricey hosted service for hosting update packages:


Advanced Installer takes a much more generous approach and offers the ability to distribute automatic updates yourself:





Registry

InstallShield offers great right-click context menus as well as the ability to import as well as export registry keys:


Advanced Installer, unfortunately, only offers the ability to import Registry keys, but no way to export them back out for future reference:

 

Team Collaboration


In the area of Team Collaboration, InstallShield offers a feature called DIM References which allows a group of installation package developers to provide specific requirements for inclusion as part of the final installation package.  These DIM References can then be aggregated and compiled to form a final installation package:


Advanced Installer currently does not offer such a feature to facilitate Team Collaboration in the same manner.

MSI Tools


InstallShield offers a set of tools to assist with working with MSI files (including an MSI Debugger), but Advanced Installer does not ship a similar set of tools:







SharePoint


InstallShield does not offer any direct support for SharePoint packages, but Advanced Installer does:



Silverlight


InstallShield does not offer any direct support for Silverlight, but Advanced Installer does:



SQL Server Reporting Services

InstallShield does not offer any direct support for SQL Server Reporting Services, but Advanced Installer does:



Based on the above comparison, both of these tools address different needs.  InstallShield lacks many usability features that Advanced Installer provides, but excels above and beyond Advanced Installer when it comes to overall flexibility as well as build automation for use in continuous integration processes.  If you are looking for a very easy-to-use installation package with minimal build automation capabilities, Advanced Installer remains the clear winner for overall usability, but now you can decide for yourself.