Getting Ready for Vista

January 8th, 2007

With the commercial release of Windows Vista just a few weeks away, it is important for developers to prepare for the latest version of the Windows operating system and the changes that it introduces. Many companies that decide to upgrade will typically use phased deployment where the upgrade process occurs over a period of several months. This means that it’s not too late (or too early) to start thinking about what you need to do to ensure your users have a smooth transition to the Vista platform.

User Account Control
Aside from the user interface, the new User Account Control (UAC) system is probably the first thing that you’ll notice. There’s been a lot written about UAC, but the bottom line is that applications no longer have unrestricted access to the entire system, even if the user has an account with administrative privileges. Whenever you attempt to perform a system maintenance function, copy files to a protected folder, modify the registry or install an application, UAC will block the application and prompt the user to confirm the action. When UAC is enabled, essentially all applications run with restricted privileges, regardless of what groups the user is a member of. This impacts programs in several important ways, including how they are installed, how they store configuration information and create data files.

Software Installation
When a user installs your software, it will typically require elevated privileges and they will be presented with a UAC prompt, asking them to confirm the installation. This will allow your installer to register components, create file associations and add the other registry entries that it requires. It will also allow your installer to store files in protected system folders under C:\Windows and C:\Program Files. A consequence of this is that you should not launch your application (or another application, such as a web browser) at the end of your installation. The reason is that, as a process created by the installer, it will inherit those elevated privileges and be able to create files and access system resources that the user normally would not be able to.

Configuration Files
Applications should create any configuration and data files on first run, not as part of the installation process. This is because the installer runs with elevated privileges and can store files in locations that are not normally writable by the user. Related to this, you should not store configuration files or data in the same location as the executable under the C:\Program Files folder. Users only have permission to read files stored there, and cannot create or modify them. The appropriate place to store per-user configuration files is in the user’s AppData folder, and system (global) configuration files should be stored in the ProgramData folder.

Registry Access
Registry data for the application should be stored under the Software key in HKEY_CURRENT_USER, not in HKEY_CLASSES_ROOT or HKEY_LOCAL_MACHINE where the user does not have permission to create or modify keys. This will impact ActiveX controls and other COM objects because the process of registration typically requires that they create keys under HKEY_CLASSES_ROOT. In practical terms, this means that utilities like RegSvr32.exe will not work correctly unless it is run with elevated privileges. For applications that are designed for Windows XP and later versions of Windows, developers should consider deploying their software using registration-free COM activation. That also enables applications which use ActiveX controls to be deployed using ClickOnce installation.

Visual Studio
Microsoft created some controversy when they announced in September, 2006 that only Visual Studio 2005 would be supported for development under Vista. It’s important to note that it is only the Visual Studio 2003 development tools which are not supported; applications created using the .NET 1.1 Framework are fully supported under Vista. If you’re using an older version of Visual Studio, our general recommendation is to upgrade to Visual Studio 2005. If you are unable to upgrade to Visual Studio 2005, then we recommend that you continue to use Windows XP as your development platform and test deployment under Vista.

The compatibility issues with Visual Studio 2003 and Vista primarily involve the debugger and COM interop and many developers may not experience a problem using it. However, if you do encounter a problem, Microsoft will not provide updates or hotfixes to address problems specific to the Windows Vista platform. Additional information can be found on the Visual Studio section of the Microsoft Developer Network. Select Support, then Visual Studio on Windows Vista from the menu.

Microsoft has released Service Pack 1 for Visual Studio 2005 and we strongly recommended that you install it, particularly if you are using Vista as your primary development platform. Note that if you have previously installed the beta release for this service pack, you must uninstall it and reboot your system before installing the official release. If you don’t, you’ll get errors during the installation process.

SocketTools
When you install SocketTools 4.5 on Vista, you will be given a UAC prompt confirming the installation. You must install SocketTools with administrative privileges, or the installation will not complete correctly. The SocketTools components are installed into system folders, and changes are made to the registry which requires elevated privileges.

It is recommended that you provide your serial number and other related information as part of the installation process. If you have previously installed an evaluation version of SocketTools, it is recommended that you re-install the product and provide a serial number. If you wish to use either the License Manager or Registration utility that is included with SocketTools, you must run them with elevated privileges by right-clicking on the utility and selecting “Run as Administrator” from the menu.

SocketTools 5.0, the next major release of SocketTools scheduled for release in February, will be specifically designed for the changes introduced in Windows Vista. We have made internal changes to the components and libraries which significantly improves functionality under Vista, while maintaining backwards compatibility and without requiring changes to your existing code.

Leave a Reply

You must be logged in to post a comment.