Ealier we have seen some articles to register a .Net assembly into GAC using either gacutil.exe or RegAsm.exe. In this article we will see the code snippet to register the assembly into GAC using WiX.
<Directory Id="ProgramFilesFolder">
<Directory Id="ProductDirectory" Name="$(var.ProductName)">
<Directory Id="GAC" Name="GAC">
<Component Id="MyGACControl" Guid="55857611-A13E-51ED-897B-A78830F68ADC" DiskId="1">
<!-- Registering assembly in GAC -->
<File Id="F_MyGACControl" Name="MyGACCtrl.dll" LongName="MyGACControl.dll" Source="$(var.SrcPath)
\MyGACControl.dll" KeyPath="yes" Assembly=".net"/>
</Component>
</Directory>
</Directory>
</Directory>
The highlighted text - Name="GAC" Assembly=".Net", in the above code drives the .Net assembly registration into GAC.
Read the following related articles:
February 25, 2010
February 16, 2010
How do you check whether the Patch is Installed already?
This article details on the approach to detect whether the patch is applied or not and prompt the user accordingly. This post applies to Basic MSI & InstallScript MSI Projects and is tested in InstallShield 2008, 2009 & 2010 with SP1. Refer here for the steps to create a Patch using InstallShiled.
• Add a VBScript Custom Action (stored in binary table)– CheckIfPatchInstalled
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Function: CheckIfPatchInstalled
''' Purpose: Checks to see if a patch is installed and sets the value of the property
''' 'PATCHINSTALLED' to "true". This property value is used by the Custom action
''' 'CheckIfPatchInstalledError' to display an error.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function IsPatchInstalled()
Dim sProductCode, sProductVersionHF, sProductVersionCurrent
On Error Resume Next
sProductCode = Session.Property("ProductCode")
sProductVersionCurrent = Session.Installer.ProductInfo(sProductCode, "VersionString")
sProductVersionBase = Session.Property("ProductVersion")
If (sProductVersionCurrent = sProductVersionBase) Then
Session.Property("PATCHINSTALLED") = "true"
End If
End Function
• Schedule the CheckIfPatchInstalled as Immediate CA after ISSetupFilesExtract in both Install UI Sequence and Install Exec Sequence with the condition PATCH.
• Add a property PATCHINSTALLED in property manager and leave it empty.
• Add an Error Custom Action as Immediate CA after CheckIfPatchInstalled in both Install UI Sequence and Install Exec Sequence with the condition PATCH AND PATCHINSTALLED.
• Add the appropriate error message say "An existing upgrade is already installed. Please remove it before installing this upgrade." for the Error CA Or Add an entry (Error Number & Message) to the Error Table in the direct editor and use the Error Number in the CA
Create the Patch and apply the patch where the main installer is installed. Running the patch again on the same machine should display the message "An existing upgrade is already installed. Please remove it before installing this upgrade." abort the installation.
• Add a VBScript Custom Action (stored in binary table)– CheckIfPatchInstalled
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Function: CheckIfPatchInstalled
''' Purpose: Checks to see if a patch is installed and sets the value of the property
''' 'PATCHINSTALLED' to "true". This property value is used by the Custom action
''' 'CheckIfPatchInstalledError' to display an error.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function IsPatchInstalled()
Dim sProductCode, sProductVersionHF, sProductVersionCurrent
On Error Resume Next
sProductCode = Session.Property("ProductCode")
sProductVersionCurrent = Session.Installer.ProductInfo(sProductCode, "VersionString")
sProductVersionBase = Session.Property("ProductVersion")
If (sProductVersionCurrent = sProductVersionBase) Then
Session.Property("PATCHINSTALLED") = "true"
End If
End Function
• Schedule the CheckIfPatchInstalled as Immediate CA after ISSetupFilesExtract in both Install UI Sequence and Install Exec Sequence with the condition PATCH.
• Add a property PATCHINSTALLED in property manager and leave it empty.
• Add an Error Custom Action as Immediate CA after CheckIfPatchInstalled in both Install UI Sequence and Install Exec Sequence with the condition PATCH AND PATCHINSTALLED.
• Add the appropriate error message say "An existing upgrade is already installed. Please remove it before installing this upgrade." for the Error CA Or Add an entry (Error Number & Message) to the Error Table in the direct editor and use the Error Number in the CA
Create the Patch and apply the patch where the main installer is installed. Running the patch again on the same machine should display the message "An existing upgrade is already installed. Please remove it before installing this upgrade." abort the installation.
January 29, 2010
Windows Installer 4.5 Support - InstallShield 2010 SP1
This post focuses on modifying the installer for Windows Installer (MSI) 4.5 Support for Basic MSI and InstallShield MSI Projects.
Steps:
- Open the existing InstallShield project in InstallShield 2010 SP1 IDE.
- Modify the Schema under General Information - Summary Information Stream to specify the minimum Windows Installer version that is required for your Installation package. Say 405 to support Windows Installer 4.5
- If the selected minimun Windows Installer version is not available on the target system, then the installer will prompt a message and abort the installation.
- Also, you can select the Windows Installer 4.5 pre-requisite for the supported operating system from Application Data - Redistributable.
For Pre-requisite integration, you can choose either of the following 3 options based on various factors
Extract From Setup.exe - The pre-requisites will be bundled with the installer. This is applicable if the Installation Package size is not a constraint / if you want to distribute the installation package as a single compressed file.
Copy From Source Media - The pre-requisite will be stored in a folder 'ISSetupPrerequisites' parallel to the installer.
Download from the Web - At the time of installation, the pre-requisite will be downloaded on the fly from the web and installed. Internet connection is required during installation.
- If you have not downloaded the pre-requisites already to your installer development machine, right click the Pre-req and click "Dowload the selected Item".
January 13, 2010
Did you get these MSI 4.5 PreReq Integration Errors in InstallShield 2010 SP1
This post focuses on the compilation error's, - 1007 and 5054, when the pre-requisites that has other dependency is include for the installer. This article is validated against InstallShield 2010 SP1
For a requirement to support Windows Installer 4.5, for both Windows XP SP3 and Windows Server 2003 SP2 Operating System, the following Pre-Requisites were selected from Application Data -> Reditributables.
Hint :- For the compilation -1007 & -5054, open the selected pre-requisite in edit mode to view the dependencies, if any, then include the dependency file too.
For a requirement to support Windows Installer 4.5, for both Windows XP SP3 and Windows Server 2003 SP2 Operating System, the following Pre-Requisites were selected from Application Data -> Reditributables.
- Windows Installer 4.5 Update for Windows Server 2003 SP2 and later (x86)
- Windows Installer 4.5 Update for Windows XP SP3 and later (x86)
- ISDEV : error -1007: Cannot copy source '<ISPRODUCT>\SetupPrerequisites\Windows Installer\4.5\x86\Pre-Vista\WindowsServer2003-KB942288-v4-x86.exe' to target '<ISPROJECT>\Product Configuration 1\Release\DiskImages\DISK1\ISSetupPrerequisites\{a0f7f2eb-ed14-4351-a30e-ef802db4b38f}\WindowsServer2003-KB942288-v4-x86.exe'
- ISDEV : error -5054: Could not determine the size of the file "<ISPROJECT>\Product Configuration 1\Release 1\DiskImages\DISK1\ISSetupPrerequisites\{a0f7f2eb-ed14-4351-a30e-ef802db4b38f}\WindowsServer2003-KB942288-v4-x86.exe"
- ISDEV : error -1007: Cannot copy source '<ISPRODUCT>\SetupPrerequisites\Windows Installer\4.5\x86\Pre-Vista\WindowsXP-KB942288-v3-x86.exe' to target '<ISPROJECT>\Product Configuration 1\Release 1\DiskImages\DISK1\ISSetupPrerequisites\{22aa129a-8e5d-45ae-a3e4-d110703ef141}\WindowsXP-KB942288-v3-x86.exe'
- ISDEV : error -5054: Could not determine the size of the file "<ISPROJECT>\Product Configuration 1\Release 1\DiskImages\DISK1\ISSetupPrerequisites\{22aa129a-8e5d-45ae-a3e4-d110703ef141}\WindowsXP-KB942288-v3-x86.exe"
Windows Installer 4.5 Update for Windows Server 2003 SP1 and later (x86)
Windows Installer 4.5 Update for Windows XP SP2 and later (x86)Selecting these pre-requisites did help to go past the errors.
Hint :- For the compilation -1007 & -5054, open the selected pre-requisite in edit mode to view the dependencies, if any, then include the dependency file too.
December 30, 2009
Have you got these errors during Patch creation / deployment?
This post discusses on some common build time as well as runtime errors that we come across while building the Software Updates aka Patches or Hotfixes. Click here for steps to create an uninstallable patch using InstallShield 2010.
Build Error: 6415
After selecting "Minor Update to Target RTM Version" from the Advanced section of the Patch Configuration properties, you may receive the following error:
ERROR: Patch Metadata property: 'MinorUpdateTargetRTM' is not a generic MSI property.
Cause: This error occurs as a result of a bug that exists in the current version of the PatchWiz.dll distributed by Microsoft as a part of Windows Installer.
Resolution: This bug should be resolved as of PatchWiz.dll version 4.0, which will be released with the Windows Vista Platform SDK and Windows Installer 4.0.
Workaround 1: You can temporarily work around this issue by following these steps:
Check the InstallShield KB for more details.
Runtime Error 1328
Description - the following error message is displayed "Error applying patch to file [2]. It has been updated by another means, and can no longer be modified by this patch. For more information contact your patch vendor. System Error: [3]"
Quick Fix - Using Patch Design View:
Runtime Error 1646:
Description:
Even you create a un-installable patch, patch may not be uninstallable and there will not be any entry in ARP Panel.
Solution:
In Direct editor make sure that there are no new entries in table ‘Create Folder’. If any new entries are there, delete them. If any extra folder is there, then it makes the patch uninstallable.
Build Error: 6415
After selecting "Minor Update to Target RTM Version" from the Advanced section of the Patch Configuration properties, you may receive the following error:
ERROR: Patch Metadata property: 'MinorUpdateTargetRTM' is not a generic MSI property.
Cause: This error occurs as a result of a bug that exists in the current version of the PatchWiz.dll distributed by Microsoft as a part of Windows Installer.
Resolution: This bug should be resolved as of PatchWiz.dll version 4.0, which will be released with the Windows Vista Platform SDK and Windows Installer 4.0.
Workaround 1: You can temporarily work around this issue by following these steps:
- Set the Minor Upgrade to Target RTM Version property to "Yes" from the advanced view of the Patch Configuration.
- Open the direct editor (Additional Tools -> Direct Editor) and locate the MsiPatchMetaData table.
- Locate the row that contains the Property "MinorUpdateTargetRTM".
- In the company column of that row, enter 1.
- Re-build your patch.
Check the InstallShield KB for more details.
Runtime Error 1328
Description - the following error message is displayed "Error applying patch to file [2]. It has been updated by another means, and can no longer be modified by this patch. For more information contact your patch vendor. System Error: [3]"
Quick Fix - Using Patch Design View:
- Verify that all files being updated by the patch exist on the machine. If they do not, then you cannot apply a byte-level patch. To function properly, a byte-level update requires the exact copy of the file it was created for on the target system.
- Navigate to the Patch Design View and select the appropriate patch configuration.
- Select the Advanced Tab and find the Include Whole File field in the Build Settings section. Set this field to Yes.
- Finish building the patch and apply the new patch.
Runtime Error 1646:
Description:
Even you create a un-installable patch, patch may not be uninstallable and there will not be any entry in ARP Panel.
Solution:
In Direct editor make sure that there are no new entries in table ‘Create Folder’. If any new entries are there, delete them. If any extra folder is there, then it makes the patch uninstallable.
Subscribe to:
Posts (Atom)