Upgrade from Windows 10 Home to Pro

If you bought a computer with preinstalled Windows 10 Home and would like to upgrade to Pro, you have to buy Windows 10 Pro in order to get the Pro product key. In my case buying a full OEM version was cheaper than upgrade. But even having got the product key for the Pro version, you cannot simply upgrade by changing your product key. Even clean install would not help. In the BIOS of your computer there is an OEM Marker. So if the computer originally came with preinstalled Windows 10 Home, exactly that version would be installed even if you perform clean install from the install media of the Pro version. You won’t be even asked for a product key as the one in BIOS would be automatically taken.

So you need to use the following workaround. Upgrade to Pro using the default product key:

VK7JG-NPHTM-C97JM-9MPGT-3V66T

Then change the procuct key to your Pro’s one.

Source: http://answers.microsoft.com/en-us/insider/wiki/insider_wintp-insider_install/how-to-troubleshoot-product-activation-in-windows/33f31475-93b3-4d1c-812f-4b21fbd807a7

Adding Directory to PATH without Reboot or Logoff/Logon

To add “C:\New Directory” to the Path variable temporarily, i.e. for current cmd session:

set path=%path%;C:\New Directory

To add the same directory to the Path user variable:

setx path "%path%;C:\New Directory"

This command updates the Path value under the HKEY_CURRENT_USER\Environment key in the Registry.

Note the “x” in the name of the command: “setx“, not “set”.

To add the directory to the Path system variable:

setx path "%path%;C:\New Directory" /M

This command updates the Path value under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment key.

Note the “/M” parameter.

Wix Standard Bootstrapper Application without License Agreement

In the bundle file replace:

<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />

with:

<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
  <bal:WixStandardBootstrapperApplication 
    xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
    LicenseUrl=""
  />
</BootstrapperApplicationRef>

WixStandardBootstrapperApplication has three variants as explained in the WiX Manual. HyperlinkLicense is the simplest. It has a license link on the welcome page instead of a license page. It allows you to specify an empty URL for the license, in which case it would not display the link.

Links: Stackoverflow, WiX Manual.

Q&A for Remote Desktop

Q: What is key sequence for CTRL+ALT+DEL?
A: CTRL+ALT+END.

Q: How to restart/shutdown remote host?
A: Press CTRL+ALT+END, and then click “Shutdown”. Or, use the shutdown command at a command prompt.

Registration of .NET COM Assemblies with WiX

Even though it is recommended to use heat.exe in Pre-Build event to extract COM information from .NET assemblies, this method does not work if the COM component to be registered is an ActiveX control.

The only acceptably working solution I have found so far is use custom actions, for example:

<InstallExecuteSequence>
  <Custom Action='comReg' After='InstallFinalize'>NOT REMOVE</Custom>
  <Custom Action='comUnreg' Before='RemoveFiles'>Installed</Custom> 
</InstallExecuteSequence>

<CustomAction
  Id='comReg'
  Directory='INSTALLDIR'
  ExeCommand='"[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\regasm.exe" "[INSTALLDIR]my.dll" /codebase /tlb'
  Return='check' />

<CustomAction
  Id='comUnreg'
  Directory='INSTALLDIR'
  ExeCommand='"[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\regasm.exe" /u "[INSTALLDIR]my.dll"'
  Return='check' />

Of course, there are some drawbacks, but in general, the solution works.

Link: Stackoverflow.

Getting and Setting MSI Properties from InstallScript

According to InstallShield documentation, getting MSI properties can be done using MsiGetProperty() function:

MsiGetProperty(hMSI, "USERNAME", svName, nvSize);

However, the documentation does not say where to get the value passed throug the hMSI parameter. You discover it only when you start typing. IntelliSense proposes ISMSI_HANDLE as the default value, so:

MsiGetProperty(ISMSI_HANDLE, "USERNAME", svName, nvSize);

Creating a Custom Destination Path for a Component in InstallShield

This article applies to InstallScript projects and explains how to create a custom destination path using script-defined folders or public properties. It is a copy of the original article:

Q104964: Creating a Custom Destination Path

DevStudio 9.x and later users

InstallScript MSI Projects

Follow these steps to create a custom destination path using public properties:

  1. Open the Components view, under Organization.
  2. Select a component to create a custom destination path.
  3. In the Components property window, select the value for the component’s Destination property.
  4. Click the drop down and select “Browse, create, or modify a directory entry…”
  5. In the Browse for Directory window, select the Destination Computer.
  6. Click the Insert (Ins) key and name the folder, for example My Directory.
  7. Set the Directory Identifier to a public property (all capitol letters), for example MY_CUSTOM_PATH.
  8. Make sure to select the new folder My Directory and then click OK.

To define the location of the public property, in the OnFirstUIBefore event handler function, after the begin statement, call the function FeatureSetTarget. For example:

FeatureSetTarget ( MEDIA , "MY_CUSTOM_PATH" , TARGETDISK ^ "customfolder" );

The third parameter of this function should be the custom destination path.

InstallScript Projects

Follow these steps to create a custom destination path using script-defined folder:

  1. Open the Components view, under Organization.
  2. Select a component to create a custom destination path (script-defined folder).
  3. In the Components property window, select the value for the component’s Destination property.
  4. Click the drop down and select “Browse, create, or modify a directory entry…”
  5. In the Browse for Directory window, select Script-defined Folders.
  6. Click the Insert (Ins) key and name the folder, for example <MY_CUSTOM_PATH>.
  7. Make sure to select the new script-defined folder <MY_CUSTOM_PATH> and then click OK.

To define the location of the script-defined folder, in the OnFirstUIBefore event handler function, after the begin statement, call the function FeatureSetTarget. For example:

FeatureSetTarget ( MEDIA , "<MY_CUSTOM_PATH>" , TARGETDISK ^ "customfolder" );

The third parameter of this function should be the custom destination path.

Professional 7.x and 6.x users

Follow these steps to create a custom destination path using script-defined folder:

  1. Open the project workspace’s File Groups pane.
  2. Select a file group to create a custom destination path (script-defined folder).
  3. In the File Groups property and value window, double-click the file group’s Destination property.
  4. In the Destination Properties window, select Script-defined Folders.
  5. Click the New Folder button and name the folder, for example <MY_CUSTOM_PATH>, then click OK.

To define the location of the script-defined folder, in the OnFirstUIBefore event handler function, after the begin statement, call the function ComponentSetTarget. For example:

ComponentSetTarget ( MEDIA , "<MY_CUSTOM_PATH>" , TARGETDISK ^ "customfolder" );

The third parameter of this function should be the custom destination path.

Additional Information

For more information, see Help Library topic FeatureSetTarget.

Microsoft Visual C++ 2010 Redistributable Package (x64) in InstallShield LE

Flexera did not include Microsoft Visual C++ 2010 Redistributable Package (x64) in the “Redstributables” list of InstallShield 2012 Spring LE or InstallShield 2013 LE projects. Perhaps, in order to force us to buy at least the Express version. But there is no need to do that, the issue can be solved in 5 minutes.

First of all, we need to get the corresponding InstallShield Prerequisite file directly from Installshield product site:

http://saturn.installshield.com/is/prerequisites/microsoft visual c++ 2010 redistributable package (x64).prq

Just in case something goes wrong, here is the content of the file:

<?xml version="1.0" encoding="UTF-8"?>
<SetupPrereq>
	<conditions>
		<condition Type="1" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E}" FileName="" ReturnValue="" Bits="2"></condition>
	</conditions>
	<operatingsystemconditions>
		<operatingsystemcondition MajorVersion="5" MinorVersion="2" PlatformId="2" CSDVersion="" Bits="4" ProductType="1" ServicePackMajorMin="3"></operatingsystemcondition>
		<operatingsystemcondition MajorVersion="6" MinorVersion="0" PlatformId="2" CSDVersion="" Bits="4" ServicePackMajorMin="2"></operatingsystemcondition>
		<operatingsystemcondition MajorVersion="5" MinorVersion="2" PlatformId="2" CSDVersion="" Bits="4" ProductType="2|3"></operatingsystemcondition>
		<operatingsystemcondition MajorVersion="6" MinorVersion="0" PlatformId="2" CSDVersion="" Bits="4" ProductType="2|3"></operatingsystemcondition>
		<operatingsystemcondition MajorVersion="6" MinorVersion="1" PlatformId="2" CSDVersion="" Bits="4"></operatingsystemcondition>
	</operatingsystemconditions>
	<files>
		<file LocalFile="&lt;ISProductFolder&gt;\SetupPrerequisites\VC 2010 Redist\x64\vcredist_x64.exe" URL="http://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe" CheckSum="630D75210B325A280C3352F879297ED5" FileSize="0,5718872"></file>
	</files>
	<execute file="vcredist_x64.exe" cmdline="/q" cmdlinesilent="/q" returncodetoreboot="1641,3010"></execute>
	<properties Id="{8A102FA5-9E73-477b-8937-2ED4C06AF304}" Description="This prerequisite installs the Microsoft Visual C++ 2010 Runtime Libraries (x64)." AltPrqURL="http://saturn.installshield.com/is/prerequisites/microsoft visual c++ 2010 redistributable package (x64).prq"></properties>
	<behavior Reboot="2"></behavior>
</SetupPrereq>

Save it as “Microsoft Visual C++ 2010 Redistributable Package (x64)_.prq” to the SetupPrereqiuisites folder in the InstallShield installation folder. In my case that is:

C:\Program Files (x86)\InstallShield\2013LE\SetupPrerequisites

Note the underline symbol just before the “.prq” in the file name. If you save the file simply as “Microsoft Visual C++ 2010 Redistributable Package (x64).prq”, InstallShield would not “see” it. You have to rename it. Nobody knows why, but that makes the trick. Instead of adding an underline symbol you could name the file as you wish.

If you do not see the the new entry in the list, unblock the “.prq” file BEFORE copying it to the SetupPrereqiuisites folder. To unblock, right-click on the file and click “Unblock” button on the “General” tab.

If you get an error while Visual Studio tries to download redistributable packages, run it “As Administrator”.

That’s it.

Junction

Windows 2000 and higher supports directory symbolic links, where a directory serves as a symbolic link to another directory on the computer. For example, if the directory D:SYMLINK specified C:WINNTSYSTEM32 as its target, then an application accessing D:SYMLINKDRIVERS would in reality be accessing C:WINNTSYSTEM32DRIVERS. Directory symbolic links are known as NTFS junctions in Windows. Unfortunately, Windows comes with no tools for creating junctions—you have to purchase the Win2K Resource Kit, which comes with the linkd program for creating junctions. I therefore decided to write my own junction-creating tool: Junction. Junction not only allows you to create NTFS junctions, it allows you to see if files or directories are actually reparse points. Reparse points are the mechanism on which NTFS junctions are based, and they are used by Windows’ Remote Storage Service (RSS), as well as volume mount points.

Using Junction

Use junction to list junctions:

Usage: [-s]

-s Recurse subdirectories

Examples:

To determine if a file is a junction, specify the file name:

junction c:test

To list junctions beneath a directory, include the –s switch:

junction -s c:

To create a junction c:Program-Files for “c:Program Files”:

C:>md Program-Files

C:>junction c:Program-Files “c:Program Files”

To delete a junction, use the –d switch:

junction -d c:Program-Files

Junction home page: Junction