I want to document the OSD file for Royalblue Fidessa Application here as other capture done alone does not make the virtualized package work. There were certain client customizations which were required and I had to do them in the OSD file.
Here is the OSD file which I used:
<?xml version="1.0" standalone="no"?>
<SOFTPKG GUID="XXXX-XXX-XXXX-XXXX" NAME="Fidessa" VERSION="6.3.9.61056">
<IMPLEMENTATION>
<CODEBASE HREF="FILE://%SFT_SOFTGRIDSERVER%\SCCMData\Royalblue_Fidessa_6.7.0b_VFS_v1.0\Royalblue_Fidessa_6.7.0b_VFS_v1.0.sft" GUID="8XXX5-8XX0-4XX7-AXX1-5171XXXXXA0" PARAMETERS="" FILENAME="%CSIDL_PROGRAM_FILES%\royalblue\fidessa\FtwLaunch.exe" SYSGUARDFILE="Royalblue_Fidessa_6.7.0b_VFS_v1.0\osguard.cp" SIZE="15076089"/>
<VIRTUALENV TERMINATECHILDREN="FALSE">
<POLICIES>
<LOCAL_INTERACTION_ALLOWED>TRUE</LOCAL_INTERACTION_ALLOWED>
</POLICIES>
<REGISTRY>
<REGKEY HIVE="HKLM" KEY="Software\royalblue technologies\Fidessa" NOREDIR="FALSE">
<REGVALUE NAME="ReadWritePath" REGTYPE="REG_SZ">C:\ProgramData\Fidessa\Fidessa</REGVALUE>
</REGKEY>
</REGISTRY>
<ENVLIST/>
</VIRTUALENV>
<WORKINGDIR/>
<VM VALUE="Win32">
<SUBSYSTEM VALUE="windows"/>
</VM>
<OS VALUE="Win2003TS"/>
<OS VALUE="Win2003TS64"/>
<OS VALUE="Win2008R2TS64"/>
<OS VALUE="Win2008TS"/>
<OS VALUE="Win2008TS64"/>
<OS VALUE="Win7"/>
<OS VALUE="Win764"/>
<OS VALUE="WinXP"/>
<OS VALUE="WinXP64"/>
</IMPLEMENTATION>
<DEPENDENCY>
<CLIENTVERSION VERSION="4.6.0.0"/>
<SCRIPT EVENT="LAUNCH" PROTECT="FALSE" TIMING="PRE" WAIT="TRUE" EXTERN="TRUE">
<SCRIPTBODY LANGUAGE="Batch">ECHO OFF \n IF NOT EXIST "C:\ProgramData\Fidessa" MD "C:\ProgramData\Fidessa" \n IF NOT EXIST "C:\ProgramData\Fidessa\Fidessa" MD "C:\ProgramData\Fidessa\Fidessa" \n IF NOT EXIST "C:\ProgramData\Fidessa\Fidessa\install" MD "C:\ProgramData\Fidessa\Fidessa\install" \n IF NOT EXIST "C:\ProgramData\Fidessa\Fidessa\log" MD "C:\ProgramData\Fidessa\Fidessa\log" \n IF NOT EXIST "C:\ProgramData\Fidessa\Fidessa\install\USER.config" cmd.exe /c Echo Y
cacls "C:\ProgramData\Fidessa\Fidessa" /t /e /c /g Users:C \n</SCRIPTBODY>
</SCRIPT>
</DEPENDENCY>
<PACKAGE NAME="Royalblue_Fidessa_6.7.0b_VFS_v1.0"/>
<ABSTRACT>App-V 4.6 SP1</ABSTRACT>
<MGMT_SHORTCUTLIST>
<SHORTCUT LOCATION="%CSIDL_PROGRAMS%\Fidessa\Fidessa" FILENAME="Fidessa.lnk" OVERRIDDEN="TRUE" DISPLAY="Fidessa" ICON="%SFT_MIME_SOURCE%/Royalblue_Fidessa_6.7.0b_VFS_v1.0 Icons/Fidessa 6.3.9.61056.ico"/>
</MGMT_SHORTCUTLIST>
<MGMT_FILEASSOCIATIONS>
<PROGIDLIST/>
<FILEEXTENSIONLIST/>
</MGMT_FILEASSOCIATIONS>
</SOFTPKG>
The Script is the main part and the customization which was required so that the Updates from Fidessa Server are downloaded in local ProgramData directory rather than in bubble. Then this should be able to update the directory inside the bubble, hence made local interaction true. The Directory inside bubble was given write permission. Also all references to C:\ProgramData were deleted in the bubble so that the files are automatically downloaded to the local machine.
This Blog is for all people working or related to the MSI and App-V. There are lots of issues we face in everyday work regarding the technology. The sole purpose of my blog is to help others with whatever I learn. All you people out there, please help by commenting, voting, propagating and sharing my blog with your friends and colleagues but with due credit and acknowledgement to the material posted here with my name and blog url as I still do hold the copyright of the posts here.
Thursday, December 08, 2011
Wednesday, December 07, 2011
Definition of Application Re-Packaging
I have been often asked about the proper definition of Application Re-Packaging. This is the best I could find:
Application Re-packaging solution offers customized application configuration and repackaging of third-party or internally-developed applications to standardize the installation routine, reduce deployment errors, and minimize support costs.
Application Re-packaging solution offers customized application configuration and repackaging of third-party or internally-developed applications to standardize the installation routine, reduce deployment errors, and minimize support costs.
Monday, November 28, 2011
Repackaging Microsoft Visual Studio 2010 Pro (Or any other version)
There are a lot of sites referring the installation of Microsoft Visual Studio 2010 in silent mode, but if you have a closer look, no one gives the complete information on the installation and Un-installation of the package.
Here are the steps which I followed to install Visual Studio on 32 bit as well as 64 bit machines. I assure you that you can save atleast 1 to 2 man days by taking information from here before proceeding with your packaging.
Copy the compete source to a directory and name this directory as per your standard naming convention.
Copy these files to this main directory (Explanation and details also provided later)
You can use WISE Script Editor to create an exe for most of the part. Since I wanted to give the content in a simpler way, I am mentioning it like this in text for you.
Details of these files are:
Here are the steps which I followed to install Visual Studio on 32 bit as well as 64 bit machines. I assure you that you can save atleast 1 to 2 man days by taking information from here before proceeding with your packaging.
Copy the compete source to a directory and name this directory as per your standard naming convention.
Copy these files to this main directory (Explanation and details also provided later)
- VS2010_Uninstall-RTM.ENU.exe
- Dfusrprf.xml
- User.vbs
- Arpsuppress64.reg
- Arpsuppress32.reg
- Arpsuppresswow64.reg
- ConfigurationFile.ini
- Setup.vbs
- Uninstall.vbs
- Uninstall.bat
You can use WISE Script Editor to create an exe for most of the part. Since I wanted to give the content in a simpler way, I am mentioning it like this in text for you.
Details of these files are:
- VS2010_Uninstall-RTM.ENU.exe: This is the uninstall file provided by Microsoft and this will un-install any version of Visual Studio. You can download this from http://archive.msdn.microsoft.com/vs2010uninstall/Release/ProjectReleases.aspx?ReleaseId=4321
- Dfusrprf.xml:
<?xml version="1.0" encoding="utf-8" standalone="no"?> <!DOCTYPE userprefs> <dotfuscator> <p982>True</p982> <p974>False</p974> <p984>False</p984> <p979>0</p979> <p981>0</p981> <p985>False</p985> <p975> </p975> <p976> </p976> <p980>0</p980> <p973>False</p973> <p986 /> <p990>False</p990> <p987 /> <p989>0,0,0,0</p989> <p988 /> </dotfuscator>
- User.vbs: The Dfsusrprf.xml needs to be copied in each users profile, you can use active setup to run this file in each user. You can use the below content for this file:
Set oShell = CreateObject("WScript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") On Error Resume Next sCurDir = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\") - 1) sup = oShell.ExpandEnvironmentStrings ("%USERPROFILE%") If Not oFSO.FolderExists (sup & "\AppData\Local\PreEmptive Solutions\Dotfuscator Community Edition\5.0") Then oFSO.CreateFolder sup & "\AppData\Local\PreEmptive Solutions" oFSO.CreateFolder sup & "\AppData\Local\PreEmptive Solutions\Dotfuscator Community Edition" oFSO.CreateFolder sup & "\AppData\Local\PreEmptive Solutions\Dotfuscator Community Edition\5.0" End If oFSO.CopyFile sCurDir & "\dfusrprf.xml" , sup & "\AppData\Local\PreEmptive Solutions\Dotfuscator Community Edition\5.0\" , OverwriteExisting
- Arpsuppress64.reg: Suppress Add/Remove Program (ARP) Entries in 64 bit
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall] [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Help Viewer 1.0] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Team Foundation Server 2010 Object Model - ENU] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Visual Studio 2010 Tools for Office Runtime (x64)] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{034106B5-54B7-467F-B477-5B7DBB492624}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0F37D969-1260-419E-B308-EF7D29ABDE20}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1AB7EDC5-D891-34C5-9FF1-BE6A85ACC44B}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1CB6C387-65A7-327F-B4A5-7DDC75A291AF}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1D1CEEF8-3741-45BD-8E77-963E1DEBDDD3}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4A8CE6D7-4D52-43B9-970B-03FC75FAD667}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5D068141-189F-39E2-A052-E40D4B561256}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{662014D2-0450-37ED-ABAE-157C88127BEB}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8438EC02-B8A9-462D-AC72-1B521349C001}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{88BAE373-00F4-3E33-828F-96E89E5E0CB9}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8FF0ACBD-17A5-3637-95F4-D7C69723E2BF}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{94D70749-4281-39AC-AD90-B56A0E0A402E}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{95120000-00B9-0409-1000-0000000FF1CE}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B40EE88B-400A-4266-A17B-E3DE64E94431}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D4AD39AD-091E-4D33-BB2B-59F6FCB8ADC3}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DA67488A-2689-4F10-B90F-D2F6977509D6}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F5079164-1DB9-3BDA-853B-F78AF67CE071}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FCADA26A-5672-31DD-BF0E-BA76ECF9B02D}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0826F9E4-787E-481D-83E0-BC6A57B056D5}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{BBDE8A3D-64A2-43A6-95F3-C27B87DF7AC1}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 10 Release] "SystemComponent"=dword:00000001
- Arpsuppress32.reg: Suppress ARP entries in 32 bit
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall] [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB968369] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Help Viewer 1.0] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 10] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 10 Release] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Team Foundation Server 2010 Object Model - ENU] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Visual Studio 2010 Tools for Office Runtime (x86)] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Visual Studio 2010 Professional - ENU] "DisplayName"="Microsoft_VisualStudio2010Pro_10.0.30319.1_0_EN_DTP_v1.0" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Visual Studio Macro Tools] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{035400A4-29BD-3723-BEED-E2718A68CDE0}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0DDCEC37-369C-484B-B16D-B4413FD42FB9}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0F37D969-1260-419E-B308-EF7D29ABDE20}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{112C23F2-C036-4D40-BED4-0CB47BF5555C}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{14DD7530-CCD2-3798-B37D-3839ED6A441C}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{170DE2A7-4768-370C-9671-D8D17826EFBF}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1803A630-3C38-4D2B-9B9A-0CB37243539C}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{196E77C5-F524-4B50-BD1A-2C21EEE9B8F7}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2012098D-EEE9-4769-8DD3-B038050854D4}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2A2F3AE8-246A-4252-BB26-1BEB45627074}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2D9FEBEE-F1B7-344F-BFDF-760E18332D96}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{33AE9E89-47C9-4A0D-9E9D-BDD6966A3804}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3A9FC03D-C685-4831-94CF-4EDFD3749497}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3BB19A2B-B9C5-3872-8FDF-3047CC9F9841}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{40416836-56CC-4C0E-A6AF-5C34BADCE483}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{41B31ABE-5A6E-498A-8F28-3BA3B8779A41}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{47C39E4A-28F2-33B1-B9B7-97F24E52D917}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4815BD99-96A4-49FE-A885-DCF06E9E4E78}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4A6F34E2-09E5-4616-B227-4A26A488A6F9}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4E968D9C-21A7-4915-B698-F7AEB913541D}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4F44B5AE-82A6-4A8A-A3E3-E24D489728E3}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{58721EC3-8D4E-4B79-BC51-1054E2DDCD10}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6A86554B-8928-30E4-A53C-D7337689134D}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6CDEAD7E-F8D8-37F7-AB6F-1E22716E30F3}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6ED37A91-7710-3183-BE50-AB043FF6689E}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{729A3000-BC8A-3B74-BA5D-5068FE12D70C}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{78C3657E-742C-40B1-9F53-E5A921D40F17}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{97CE8B73-AA5A-4987-A1BE-50DD1A187478}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC41D924-8C68-4BD5-A7A1-0AE4176C31A6}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ACE28263-76A4-4BF5-B6F4-8BD719595969}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B5153233-9AEE-4CD4-9D2C-4FAAC870DBE2}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B7E38540-E355-3503-AFD7-635B2F2F76E1}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B857D868-F8B0-43EE-BC2B-D9E5ED21F237}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{BC0464FA-A0BA-3E38-85BF-DC5B3A401F48}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C688457E-03FD-4941-923B-A27F4D42A7DD}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C6DD625F-4B61-4561-8286-87CA0275CEA1}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C965F01C-76EA-4BD7-973E-46236AE312D7}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{CFEF48A8-BFB8-3EAC-8BA5-DE4F8AA267CE}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D441BD04-E548-4F8E-97A4-1B66135BAAA8}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DC3D6AFB-78B4-489F-81D7-30B66E0C2417}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E5AE9031-79A5-4627-9641-BEFA82819B08}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F3494AB6-6900-41C6-AF57-823626827ED8}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F990B526-8F7C-46E0-B1F1-6C893A8B478F}] "SystemComponent"=dword:00000001
- Arpsuppresswow64.reg: Suppress entries which are going through wow6432 node in registry.
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall] [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Visual Studio Macro Tools] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{0DDCEC37-369C-484B-B16D-B4413FD42FB9}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{0E3DFC64-CC49-4BE2-8C9C-58EF129675DB}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{112C23F2-C036-4D40-BED4-0CB47BF5555C}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{14DD7530-CCD2-3798-B37D-3839ED6A441C}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{1803A630-3C38-4D2B-9B9A-0CB37243539C}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{2012098D-EEE9-4769-8DD3-B038050854D4}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{2A2F3AE8-246A-4252-BB26-1BEB45627074}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{2D9FEBEE-F1B7-344F-BFDF-760E18332D96}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{3A9FC03D-C685-4831-94CF-4EDFD3749497}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{40416836-56CC-4C0E-A6AF-5C34BADCE483}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{41B31ABE-5A6E-498A-8F28-3BA3B8779A41}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{4E968D9C-21A7-4915-B698-F7AEB913541D}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{6A86554B-8928-30E4-A53C-D7337689134D}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{6CDEAD7E-F8D8-37F7-AB6F-1E22716E30F3}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{729A3000-BC8A-3B74-BA5D-5068FE12D70C}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{78C3657E-742C-40B1-9F53-E5A921D40F17}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC41D924-8C68-4BD5-A7A1-0AE4176C31A6}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{ACE28263-76A4-4BF5-B6F4-8BD719595969}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{B7E38540-E355-3503-AFD7-635B2F2F76E1}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{BC0464FA-A0BA-3E38-85BF-DC5B3A401F48}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{CFEF48A8-BFB8-3EAC-8BA5-DE4F8AA267CE}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{E5AE9031-79A5-4627-9641-BEFA82819B08}] "SystemComponent"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C688457E-03FD-4941-923B-A27F4D42A7DD}] "SystemComponent"=dword:00000001
- ConfigurationFile.ini: To Un-install SQL Server 2008 completely use below content”
;SQLSERVER2008 Configuration File [SQLSERVER2008] ; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter. ACTION="Uninstall" ; Specifies features to install, uninstall, or upgrade. The list of top-level features include SQL, AS, RS, IS, and Tools. The SQL feature will install the database engine, replication, and full-text. The Tools feature will install Management Tools, Books online, Business Intelligence Development Studio, and other shared components. FEATURES=SQLENGINE,REPLICATION,SNAC_SDK ; Displays the command line parameters usage HELP="False" ; Specifies that the detailed Setup log should be piped to the console. INDICATEPROGRESS="False" ; Setup will not display any user interface. QUIET="True" ; Setup will display progress only without any user interaction. QUIETSIMPLE="False" ; Specifies that Setup should install into WOW64. This command line argument is not supported on an IA64 or a 32-bit system. X86="False" ; Specify a default or named instance. MSSQLSERVER is the default instance for non-Express editions and SQLExpress for Express editions. This parameter is required when installing the SQL Server Database Engine (SQL), Analysis Services (AS), or Reporting Services (RS). INSTANCENAME="SQLEXPRESS"
- Setup.vbs: To install the package with customizations
Dim oExplorer Dim oShell ' Windows Scripting Host shell Dim oFSO ' File system object Dim sCurDir, AppName, srd ' Script path Dim sWinDir ' Windows root path Dim sProgress ' Text in IE window Dim scpf86, spf, strAppMsg, oEnv '======================================================================= ' Main On Error Resume Next Set oShell = CreateObject("WScript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") sCurDir = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\") - 1) sWinDir = oShell.ExpandEnvironmentStrings ("%WinDir%") Const HKEY_LOCAL_MACHINE = &H80000002 AppName = "Microsoft_VisualStudio2010Pro_10.0.30319.1" set oEnv = oShell.Environment("PROCESS") oEnv("SEE_MASK_NOZONECHECKS") = 1 If Not oFSO.FolderExists (sWinDir & "\logs") Then oFSO.CreateFolder sWinDir & "\logs" ' Install Microsoft Visual Studio 2010 oShell.Run chr(34) & sCurDir & "\Setup\setup.exe" & Chr(34) & " /q /full /norestart" , 1, 1 '#################### Installation Date #################### strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_LocalTime") For Each objItem in colItems mn= objItem.Month dy= objItem.Day if Len(objItem.Day) =1 then dy="0" & objItem.Day end if If Len(objItem.Month) =1 then Mn="0" & objItem.Month end if mix=dy & "/" & Mn & "/" & objItem.Year Next ' Const HKEY_LOCAL_MACHINE = &H80000002 Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") strValueName2 = "Installation Date" strValue2 = mix ‘This is for inventory key installation date, you can leave this ‘oShell.Run "reg.exe IMPORT " & chr(34) & sCurDir & "\Inventory.reg" & chr(34) If oFSO.FolderExists (srd & "\Program Files (x86)") Then oShell.Run sWinDir & "\sysnative\reg.exe IMPORT " & chr(34) & sCurDir & "\arpsupress64.reg" & chr(34) oShell.Run sWinDir & "\sysnative\reg.exe IMPORT " & chr(34) & sCurDir & "\arpsupresswow64.reg" & chr(34) Else oShell.Run "reg.exe IMPORT " & chr(34) & sCurDir & "\arpsuprees32.reg" & chr(34) End If strKeyPath2 = "SOFTWARE\XXXApps\Desktop\" & AppName oshell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\XXXApps\Desktop\" & AppName & "\Installation Date", strValue2, "REG_SZ" ' ##################Copy Config File######################### sCPF86=oShell.ExpandEnvironmentStrings ("%commonprogramfiles(x86)%") If oFSO.FolderExists(sCPF86) Then spf = oShell.ExpandEnvironmentStrings ("%programfiles(x86)%") Else spf = oShell.ExpandEnvironmentStrings ("%programfiles%") End if Const OverwriteExisting = TRUE oFSO.CopyFile sCurDir & "\ConfigurationFile.ini" , spf & "\Microsoft Visual Studio 10.0\Common7\", OverwriteExisting oFSO.CopyFile sCurDir & "\VS2010_Uninstall-RTM.ENU.exe" , spf & "\Microsoft Visual Studio 10.0\Common7\", OverwriteExisting '####################Edit ARP Info############################## If oFSO.FolderExists(sCPF86) Then strKeyPath11 = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Visual Studio 2010 Professional - ENU" Else strKeyPath11 = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Visual Studio 2010 Professional - ENU" End if strValueName13 = "NoModify" dwvalue11 = 1 strValueName14 = "NoRemove" oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath11,strValueName13,dwValue11 oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath11,strValueName14,dwValue11 strStringValueName15 = "HelpLink" strStringValueName16 = "URLUpdateInfo" strStringValueName17 = "Readme" oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath11,strStringValueName15 oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath11,strStringValueName16 oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath11,strStringValueName17 '################Edit Shortcut########################### spd = oShell.ExpandEnvironmentStrings ("%ProgramData%") oFSO.DeleteFile(spd & "\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 2010\Microsoft Windows SDK Tools\Install Microsoft FXCop.lnk") oFSO.DeleteFile(spd & "\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 2010\Microsoft Visual Studio 2010 Documentation.lnk") oFSO.DeleteFile(spd & "\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 2010\Microsoft Windows SDK Tools\Tools Reference.lnk") ' ###############Active Setup############################# oFSO.CopyFile scurDir & "\USER.vbs" , spf & "\Microsoft Visual Studio 10.0\Common7\", OverwriteExisting oFSO.CopyFile scurDir & "\dfusrprf.xml" , spf & "\Microsoft Visual Studio 10.0\Common7\", OverwriteExisting strKeyPath21 = "SOFTWARE\Microsoft\Active Setup\Installed Components\{0F37D969-1260-419E-B308-EF7D29ABDE20}" strValueName21 = "StubPath" strValue21 = spf & "\Microsoft Visual Studio 10.0\Common7\USER.vbs" oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath21 oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath21,strValueName21,strValue21 strValueName22 = "Version" strValue22 = "1,0" oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath21,strValueName22,strValue22 oShell.Run chr(34) & scurDir & "\USER.vbs" & chr(34)
- Uninstall.vbs: To Un-install MS Visual Studio Silently:
Dim oShell, oFSO, oReg Set oShell = CreateObject("WScript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") On Error Resume Next sWindir = oShell.ExpandEnvironmentStrings("%windir%") sCPF86=oShell.ExpandEnvironmentStrings ("%commonprogramfiles(x86)%") If oFSO.FolderExists(sCPF86) Then spf = oShell.ExpandEnvironmentStrings ("%programfiles(x86)%") Else spf = oShell.ExpandEnvironmentStrings ("%programfiles%") End if sys32 = sWindir & "\system32" set oEnv = oShell.Environment("PROCESS") oEnv("SEE_MASK_NOZONECHECKS") = 1 'MsgBox "The uninstallation of the application will take approximately 45 minutes to complete." , 0, "Visual Studio 2010 Pro" ' ################ Remove Active Setup #################### Const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") strKeyPath1 = "Software\Microsoft\Active Setup\Installed Components\{D7DAD1E4-45F4-3B2B-899A-EA728167EC4F}" oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath1 '###################Uninstall################ If oFSO.FolderExists(sCPF86) Then spf64 = oShell.ExpandEnvironmentStrings ("%programfiles%") oShell.Run chr(34) & spf64 & "\Microsoft SQL Server\100\Setup Bootstrap\Release\setup.exe" & chr(34) & " /ConfigurationFile=" & chr(34) & spf & "\Microsoft Visual Studio 10.0\Common7\ConfigurationFile.ini" & chr(34) ,0 ,1 oFSO.DeleteFolder(spf64 & "\Microsoft SQL Server\100") Else oShell.Run chr(34) & spf & "\Microsoft SQL Server\100\Setup Bootstrap\Release\setup.exe" & chr(34) & " /ConfigurationFile=" & chr(34) & spf & "\Microsoft Visual Studio 10.0\Common7\ConfigurationFile.ini" & chr(34) ,0 ,1 oFSO.DeleteFolder(spf & "\Microsoft SQL Server\100") End if oShell.Run chr(34) & spf & "\Microsoft Visual Studio 10.0\Common7\VS2010_Uninstall-RTM.ENU.exe" & chr(34) & " /q /full" , 0 ,1 code1 = "{B7E38540-E355-3503-AFD7-635B2F2F76E1}" code2 = "{4F44B5AE-82A6-4A8A-A3E3-E24D489728E3}" code3 = "{B40EE88B-400A-4266-A17B-E3DE64E94431}" code4 = "{BBDE8A3D-64A2-43A6-95F3-C27B87DF7AC1}" oshell.run sys32 & "\msiexec.exe /x " & code1 & " REBOOT=ReallySuppress /qn /l*v " & chr(34) & sWindir & "\Logs\MicrosoftVisualStudio_2010_Uninstall.log" & chr(34) , 1, 1 oshell.run sys32 & "\msiexec.exe /x " & code3 & " REBOOT=ReallySuppress /qn /l*v " & chr(34) & sWindir & "\Logs\MicrosoftVisualS_2010_Uninstall.log" & chr(34) , 1, 1 oshell.run sys32 & "\msiexec.exe /x " & code4 & " REBOOT=ReallySuppress /qn /l*v " & chr(34) & sWindir & "\Logs\SQLServer2008NativeClient_2010_Uninstall.log" & chr(34) , 1, 1 If Not oFSO.FolderExists(sCPF86) Then oshell.run sys32 & "\msiexec.exe /x " & code2 & " REBOOT=ReallySuppress /qn /l*v+ " & chr(34) & sWindir & "\Logs\MicrosoftSQLServer_2008SetupSupportFiles_Uninstall.log" & chr(34) , 1, 1 End if ' #################Remove Registry############################### strKeyPath = "SOFTWARE\XXXApps\Desktop\Microsoft_VisualStudio2010Pro_10.0.30319.1_0_EN_DTP_v1.0" oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath '################## Clean Uninstall ############################## spd = oShell.ExpandEnvironmentStrings ("%Programdata%") sup = oShell.ExpandEnvironmentStrings ("%UserProfile%") oFSO.DeleteFolder(spf & "\Microsoft Visual Studio 10.0") oFSO.DeleteFolder(sup & "\Documents\Visual Studio 2010") oFSO.DeleteFolder (spd & "\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 2010") 'Msgbox "Uninstallation of the application is completed. Please reboot your system." , 0, "Visual Studio 2010 Pro" oEnv.Remove("SEE_MASK_NOZONECHECKS")
- Uninstall.bat: To uninstall through deployment tool, you should use this .bat file so that it removes SQL and all other components as well. I have made this batch script so that it runs on both 32 and 64 bit machines:
@echo off if exist %windir%\sysnative\cmd.exe ( cd %windir%\sysnative ) SET SUBDIR=%~dp0 wscript.exe %SUBDIR%Uninstall.vbs
Wednesday, November 02, 2011
Frequently asked Questions about COM and Windows installer (MSI) / Application Packaging
What does the common language runtime do?
The common language runtime manages the execution of code and provides services such as cross-language integration, code access security, object lifetime management, and debugging and profiling support. Search for "Common Language Runtime" in the MSDN Library (msdn.microsoft.com/library/).
What's the difference between managed and unmanaged code?
Code developed with a language compiler that targets the common language runtime is called managed code. All code based on Microsoft intermediate language (MSIL) executes as managed code. Managed code is self-describing; it contains metadata that describes every element managed by the common language runtime. The runtime uses the metadata to provide services.
Code that runs outside the runtime and does not contain metadata is called unmanaged code. Examples of unmanaged code are COM components, ActiveX interfaces, and Win32 API functions. Unmanaged code executes in the common language runtime environment with minimal services.
Can I add managed code to an existing application?
Few developers are able to rewrite existing applications completely as managed (.NET) code. Instead, you can combine managed and unmanaged components in one installation. Code that contains a mix of managed and unmanaged elements is called interoperable code.
The common language runtime supports COM interoperability (interop). For backward compatibility, COM interop provides access to existing COM components without requiring you to modify the original components. COM interop also enables your COM clients to access managed code as easily as they access other COM objects. This is accomplished by adding information to the system registry so .NET components are called as though they were COM components. At runtime, the common language runtime marshals data between COM objects and managed objects as needed.
Search for "Interoperating with Unmanaged Code" in the MSDN Library (msdn.microsoft.com/library/).
What is an assembly?
An assembly is the primary building block of a .NET application. An assembly contains its own naming, binding, versioning, deployment, and configuration information. It consists of 2 elements: a manifest, which is the meta data that describes information about the assembly and any resources it depends on; and a set of instructions in the form of Microsoft Intermediate Language (MSIL) code that is executed when the assembly is referenced.
You can group assembly elements into a single file assembly, which incorporates the manifest into a portable executable (PE) file, which can be an .EXE or .DLL, with the source code. You also can create a multifile assembly consisting of modules of compiled code, resources, or other files required by the application. In a multifile assembly, the manifest can be a standalone file or it can be incorporated into one of the PE files in the assembly.
When you add a .NET assembly to an installation, Windows Installer Editor creates entries in the MsiAssembly and MsiAssemblyName tables.
See Assemblies in the Windows Installer SDK Help.
How does .NET reduce file sharing conflicts?
An important benefit of .NET installations is the reduction of file sharing conflicts. With the common language runtime, the assembly is described by a manifest; the registry is no longer relied upon for storing and accessing the COM activation data. This allows components to be fully isolated from each other.
Assembly sharing is accomplished in several ways:
a) Global Assembly Cache
To install .NET assemblies that are intended to be shared by many applications on the computer, make sure they are strongly named and install them into the Global Assembly Cache, which is a machine-wide code cache. Do not install assemblies into the Global Assembly Cache unless they specifically need to be shared. The Global Assembly Cache is available only if the .NET Framework is installed on the destination computer.
b) Side-by-side
To safely share COM or Win32 assemblies among multiple applications and to minimize .DLL conflicts, use side-by-side assembly sharing. Instead of having a single version of an assembly that assumes backward compatibility with all applications, side-by-side assembly sharing enables multiple versions of a COM or Win32 assembly to run simultaneously on the destination computer. Side-by-side assembly sharing is available only on Windows XP or later. See Side-by-Side Assemblies in the Windows Installer SDK Help.
c) Private assembly
To reserve a Win32 assembly for the exclusive use of one application, install it in a directory that is private to the application, typically the application directory. This is called a private assembly. The dependency of the application on the private assembly is specified in an application manifest file. On operating systems earlier than Windows XP, a copy of the private assembly and a .local file is installed into a private directory for the exclusive use of the application. A version of the assembly is also globally registered on the system and made available for any application that binds to it. The global version of the assembly can be the version installed with the application or an earlier version.
I thought .NET meant I could use XCOPY to install applications without registration. Why do I need to build a Windows Installer installation?
For a .NET application that uses only managed code and private assemblies, the installation process can be as simple as copying files to the destination computer. Most developers, however, still need to create a compressed, single-file installation that is easy to deploy and that provides a friendly interface to the end user.
.NET applications that use shared assemblies, or that have a mix of managed and unmanaged code, cannot be installed via XCOPY. You should use the Windows Installer service for installations that do any of the following:
a)Install COM files
b)Install assemblies to the Global Assembly Cache
c)Require user information during the installation
d)Require security
e)Create a shortcut
f)Require elevated privileges to install on a locked-down computer
By creating a Windows Installer installation for your .NET applications, you can take advantage of the services Windows Installer provides: installation, repair, and removal of assemblies; roll back; install-on-demand; patching; and advertisement.
How does Windows Installer Editor support .NET installations?
Windows Installer Editor lets you install .NET assemblies into the Global Assembly Cache, or as side-by-side or private assemblies. It also lets you create mixed installations by registering .NET assemblies with COM.
If the .NET Framework is installed on your computer, Windows Installer Editor can automate the process as follows:
a) Find all files in multifile assemblies and add them to the installation.
b) Scan for assembly dependencies and add them to the installation.
c) Determine attributes for registering the assembly files and add them to the MsiAssemblyName table.
d) Add registry keys for COM interop.
The common language runtime manages the execution of code and provides services such as cross-language integration, code access security, object lifetime management, and debugging and profiling support. Search for "Common Language Runtime" in the MSDN Library (msdn.microsoft.com/library/).
What's the difference between managed and unmanaged code?
Code developed with a language compiler that targets the common language runtime is called managed code. All code based on Microsoft intermediate language (MSIL) executes as managed code. Managed code is self-describing; it contains metadata that describes every element managed by the common language runtime. The runtime uses the metadata to provide services.
Code that runs outside the runtime and does not contain metadata is called unmanaged code. Examples of unmanaged code are COM components, ActiveX interfaces, and Win32 API functions. Unmanaged code executes in the common language runtime environment with minimal services.
Can I add managed code to an existing application?
Few developers are able to rewrite existing applications completely as managed (.NET) code. Instead, you can combine managed and unmanaged components in one installation. Code that contains a mix of managed and unmanaged elements is called interoperable code.
The common language runtime supports COM interoperability (interop). For backward compatibility, COM interop provides access to existing COM components without requiring you to modify the original components. COM interop also enables your COM clients to access managed code as easily as they access other COM objects. This is accomplished by adding information to the system registry so .NET components are called as though they were COM components. At runtime, the common language runtime marshals data between COM objects and managed objects as needed.
Search for "Interoperating with Unmanaged Code" in the MSDN Library (msdn.microsoft.com/library/).
What is an assembly?
An assembly is the primary building block of a .NET application. An assembly contains its own naming, binding, versioning, deployment, and configuration information. It consists of 2 elements: a manifest, which is the meta data that describes information about the assembly and any resources it depends on; and a set of instructions in the form of Microsoft Intermediate Language (MSIL) code that is executed when the assembly is referenced.
You can group assembly elements into a single file assembly, which incorporates the manifest into a portable executable (PE) file, which can be an .EXE or .DLL, with the source code. You also can create a multifile assembly consisting of modules of compiled code, resources, or other files required by the application. In a multifile assembly, the manifest can be a standalone file or it can be incorporated into one of the PE files in the assembly.
When you add a .NET assembly to an installation, Windows Installer Editor creates entries in the MsiAssembly and MsiAssemblyName tables.
See Assemblies in the Windows Installer SDK Help.
How does .NET reduce file sharing conflicts?
An important benefit of .NET installations is the reduction of file sharing conflicts. With the common language runtime, the assembly is described by a manifest; the registry is no longer relied upon for storing and accessing the COM activation data. This allows components to be fully isolated from each other.
Assembly sharing is accomplished in several ways:
a) Global Assembly Cache
To install .NET assemblies that are intended to be shared by many applications on the computer, make sure they are strongly named and install them into the Global Assembly Cache, which is a machine-wide code cache. Do not install assemblies into the Global Assembly Cache unless they specifically need to be shared. The Global Assembly Cache is available only if the .NET Framework is installed on the destination computer.
b) Side-by-side
To safely share COM or Win32 assemblies among multiple applications and to minimize .DLL conflicts, use side-by-side assembly sharing. Instead of having a single version of an assembly that assumes backward compatibility with all applications, side-by-side assembly sharing enables multiple versions of a COM or Win32 assembly to run simultaneously on the destination computer. Side-by-side assembly sharing is available only on Windows XP or later. See Side-by-Side Assemblies in the Windows Installer SDK Help.
c) Private assembly
To reserve a Win32 assembly for the exclusive use of one application, install it in a directory that is private to the application, typically the application directory. This is called a private assembly. The dependency of the application on the private assembly is specified in an application manifest file. On operating systems earlier than Windows XP, a copy of the private assembly and a .local file is installed into a private directory for the exclusive use of the application. A version of the assembly is also globally registered on the system and made available for any application that binds to it. The global version of the assembly can be the version installed with the application or an earlier version.
I thought .NET meant I could use XCOPY to install applications without registration. Why do I need to build a Windows Installer installation?
For a .NET application that uses only managed code and private assemblies, the installation process can be as simple as copying files to the destination computer. Most developers, however, still need to create a compressed, single-file installation that is easy to deploy and that provides a friendly interface to the end user.
.NET applications that use shared assemblies, or that have a mix of managed and unmanaged code, cannot be installed via XCOPY. You should use the Windows Installer service for installations that do any of the following:
a)Install COM files
b)Install assemblies to the Global Assembly Cache
c)Require user information during the installation
d)Require security
e)Create a shortcut
f)Require elevated privileges to install on a locked-down computer
By creating a Windows Installer installation for your .NET applications, you can take advantage of the services Windows Installer provides: installation, repair, and removal of assemblies; roll back; install-on-demand; patching; and advertisement.
How does Windows Installer Editor support .NET installations?
Windows Installer Editor lets you install .NET assemblies into the Global Assembly Cache, or as side-by-side or private assemblies. It also lets you create mixed installations by registering .NET assemblies with COM.
If the .NET Framework is installed on your computer, Windows Installer Editor can automate the process as follows:
a) Find all files in multifile assemblies and add them to the installation.
b) Scan for assembly dependencies and add them to the installation.
c) Determine attributes for registering the assembly files and add them to the MsiAssemblyName table.
d) Add registry keys for COM interop.
Thursday, September 08, 2011
Creating MSI for x64 and x86 machines
For some time now I have been packaging for x64 and x86 machines, and have faced numerous issues while creating the MSI for x64 machines. Well MSI will mostly work in x86 because of less complexity of 32 bit machine. There always seems to be a problem when you try to install the application in 64 bit environment.
Registry Structure:
The Registries install differently in 32 and 64 bit machines. in 64 bit machines, there is a provision to install 32 bit applications registry and this goes in SysWOW64 folder.
By default all 32 bit installers install the registry in SysWOW64 hive. If you need to install the registries in normal mode as in directly in the registry as it was in 32 bit machines, then you need to change the Component in your MSI to 64 bit component. This will ensure that your registries are to be installed as 64 bit and not 32 bit.
You might face issue in compiling your 32 bit application with a 64 bit component. I would suggest you to compile your Application with 32 bit component and change the component attribute with ORCA later on.
Folder Structure:
I would like to share the 2 basic folders which are different in 64-bit machines.
• Program Files: There are two folders for Program Files in 64 bit machines and they are Program Files and Program Files (x86). All applications which have 64 bit installer are installed in "Program Files" folder, whereas all 32 bit applications are by default installed in "Program Files (x86) folder.
• System folder: The System 32 folder also behaves in the similar manner as Program Files and in this for 64 bit installers, the files which are to be placed in System 32 are directed to "System32" Folder only. The 32 bit installers however place these file in "SysWOW64" Folder.
Now the question comes to package the applications in such a way that we get desired output. I will list down certain scenarios and how to handle them in packaging. I hope to cover most as in whatever issues I have faced and your feedback for more scenarios is most welcome.
a) Scenario: In a capture application, files are getting installed in SysWOW64/Program Files (x86) folder when you want the files to be placed in System32/Program Files folder.
Resolution: You need to check the Summary section in your WISE Package Studio. If your package is marked as Intel,1033 (or Intel,xxxx), then you need to change this to x64,1033 (or x64,xxxx).
By doing this you are changing the installer type from 32 bit to 64 bit. You cannot install this package now on 32 bit machines and you will have to create a separate installer for that. I have done a lot of research and this only seems to be the most viable option as of now.
Also you need to change your directory in WISE package Studio/MSI.
There are additions of new already defined folders in MSI for 64 bit support. These folders are explained below:
[ProgramFiles64Folder] will redirect files to “Program Files" folder and [ProgramFilesFolder] will redirect the files to "Program Files (x86)" folder in 64 bit machines.
[System64Folder] will redirect files to "C:\Windows\System32" folder and [SystemFolder] will redirect the files to "C:\Windows\SysWOW64" folder in 64 bit machines.
Choose accordingly in your package. If there is still some problems, you can try making the components to be 64-Bit and try again.
b) Scenario: There is a vendor MSI which is 32 bit and install files to "Program Files (x86)" Folder in x64 machine. But due to the functionality of the application, you would require it to install to "Program Files" folder.
Resolution: If you are thinking that you will change the Summary section in MST file from Intel,1033 to x64,1033 and it will work, well you are thinking in right direction, but it does not work. You will have to change the summary section in MSI directly through ORCA and then do rest of the customizations in MST.
WIN64DUALFOLDERS determines what happens to the path variables while installation of an MSI. Based on the application type as in 64 bit or 32 bit, the paths are determined.
If it is a 64 bit installer then you will see something like this in the log file:
WIN64DUALFOLDERS: Substitution in 'C:\Program Files (x86)\ABC\XYZ\' folder had been blocked by the 1 mask argument (the folder pair's iSwapAttrib member = 0).
This means that the file system redirection will not happen. All paths will be defined as desired.
For example:
ProgramFilesFolder will be C:\Program Files (x86)
ProgramFiles64Folder will be C:\Program Files
and so on...
The end result would be as expected.
The 64-bit msiexec.exe is used in the whole process.
If it is a 32 bit installer then you will see something like this in the log file:
WIN64DUALFOLDERS: 'C:\Program Files (x86)\' will substitute 17 characters in 'C:\Program Files\' folder path. (mask argument = 0, the folder pair's iSwapAttrib member = 0).
This means:
ProgramFilesFolder will be C:\Program Files (x86)
ProgramFiles64Folder will become C:\Program Files (x86)
I hope this will help you in Packaging your applications for 64 bit.
Registry Structure:
The Registries install differently in 32 and 64 bit machines. in 64 bit machines, there is a provision to install 32 bit applications registry and this goes in SysWOW64 folder.
By default all 32 bit installers install the registry in SysWOW64 hive. If you need to install the registries in normal mode as in directly in the registry as it was in 32 bit machines, then you need to change the Component in your MSI to 64 bit component. This will ensure that your registries are to be installed as 64 bit and not 32 bit.
You might face issue in compiling your 32 bit application with a 64 bit component. I would suggest you to compile your Application with 32 bit component and change the component attribute with ORCA later on.
Folder Structure:
I would like to share the 2 basic folders which are different in 64-bit machines.
• Program Files: There are two folders for Program Files in 64 bit machines and they are Program Files and Program Files (x86). All applications which have 64 bit installer are installed in "Program Files" folder, whereas all 32 bit applications are by default installed in "Program Files (x86) folder.
• System folder: The System 32 folder also behaves in the similar manner as Program Files and in this for 64 bit installers, the files which are to be placed in System 32 are directed to "System32" Folder only. The 32 bit installers however place these file in "SysWOW64" Folder.
Now the question comes to package the applications in such a way that we get desired output. I will list down certain scenarios and how to handle them in packaging. I hope to cover most as in whatever issues I have faced and your feedback for more scenarios is most welcome.
a) Scenario: In a capture application, files are getting installed in SysWOW64/Program Files (x86) folder when you want the files to be placed in System32/Program Files folder.
Resolution: You need to check the Summary section in your WISE Package Studio. If your package is marked as Intel,1033 (or Intel,xxxx), then you need to change this to x64,1033 (or x64,xxxx).
By doing this you are changing the installer type from 32 bit to 64 bit. You cannot install this package now on 32 bit machines and you will have to create a separate installer for that. I have done a lot of research and this only seems to be the most viable option as of now.
Also you need to change your directory in WISE package Studio/MSI.
There are additions of new already defined folders in MSI for 64 bit support. These folders are explained below:
[ProgramFiles64Folder] will redirect files to “Program Files" folder and [ProgramFilesFolder] will redirect the files to "Program Files (x86)" folder in 64 bit machines.
[System64Folder] will redirect files to "C:\Windows\System32" folder and [SystemFolder] will redirect the files to "C:\Windows\SysWOW64" folder in 64 bit machines.
Choose accordingly in your package. If there is still some problems, you can try making the components to be 64-Bit and try again.
b) Scenario: There is a vendor MSI which is 32 bit and install files to "Program Files (x86)" Folder in x64 machine. But due to the functionality of the application, you would require it to install to "Program Files" folder.
Resolution: If you are thinking that you will change the Summary section in MST file from Intel,1033 to x64,1033 and it will work, well you are thinking in right direction, but it does not work. You will have to change the summary section in MSI directly through ORCA and then do rest of the customizations in MST.
WIN64DUALFOLDERS determines what happens to the path variables while installation of an MSI. Based on the application type as in 64 bit or 32 bit, the paths are determined.
If it is a 64 bit installer then you will see something like this in the log file:
WIN64DUALFOLDERS: Substitution in 'C:\Program Files (x86)\ABC\XYZ\' folder had been blocked by the 1 mask argument (the folder pair's iSwapAttrib member = 0).
This means that the file system redirection will not happen. All paths will be defined as desired.
For example:
ProgramFilesFolder will be C:\Program Files (x86)
ProgramFiles64Folder will be C:\Program Files
and so on...
The end result would be as expected.
The 64-bit msiexec.exe is used in the whole process.
If it is a 32 bit installer then you will see something like this in the log file:
WIN64DUALFOLDERS: 'C:\Program Files (x86)\' will substitute 17 characters in 'C:\Program Files\' folder path. (mask argument = 0, the folder pair's iSwapAttrib member = 0).
This means:
ProgramFilesFolder will be C:\Program Files (x86)
ProgramFiles64Folder will become C:\Program Files (x86)
I hope this will help you in Packaging your applications for 64 bit.
Tuesday, August 16, 2011
Shortcut creation issue in Installshield/WISE Package Studio
IIS Express 7.5 is a vendor MSI package and the MSI is created by WiX. Though there is no problem as such while
customizing this application, but I found an issue while adding a shortcut to this application.
While creating IIS Express 7.5 package recently, I faced an issue that I was not able to add shortcut in this
application.
This for the matter of fact I realized that the shortcut table did not exist in this application. The error which
I was getting was "Field shortcut of table shortcut: Error retrieving shortcut of table"
To get this error fixed, I added the shortcut table and following entries in _Validation table:
After adding this I added CreateShortcuts Action in InstallExecuteSequence Table at Sequence 4500. This was
because, since there was no shortcut table, the sequence too was missing from MSI. Due to this the shortcut was
not getting created.
Once I did both these things, the application is installed fine with the shorcut.
This can be used with other missing tables as well. We need to add the entries in _Validation table for all the
tables which are missing for its every corresponding column.
Hope this will help you if you face similar issue in future.
Thursday, August 11, 2011
Installing executable from remote location by suppressing the Open File Prompt
Many times while running a script/application exe from a network we get an error that the application is not from a trusted source and if we want to install the particular application or not.
This error comes because the source is not digitally signed and the Operating System prompts to ask from user if it is a known source to user or if something malicious is being run from network. This is just to protect the end users from the malicious software or Virus attack.
Technically,
This behavior was introduced in Windows XP SP2 because of the addition of the Attachment Execution Services (AES). Every program that is run by using the ShellExecute() API passes through AES. AES considers the downloaded update file to be from the Internet Zone. Therefore, AESdisplays the Open File - Security Warning dialog box. AES examines the file to see whether the file has a file stream of the type Zone.Identifier. Then AES determines what zone the file is from and what level of protection to apply when the file is run.
You can use the below code to suppress this message for your application to work fine.
set oShell= CreateObject("Wscript.Shell")
set oEnv = oShell.Environment("PROCESS")
oEnv("SEE_MASK_NOZONECHECKS") = 1
<Your Code here>
oEnv.Remove("SEE_MASK_NOZONECHECKS")
Please note that you should not set this as a permanent environment variable as it will disable all Zone Checking and it is not recommended.
This error comes because the source is not digitally signed and the Operating System prompts to ask from user if it is a known source to user or if something malicious is being run from network. This is just to protect the end users from the malicious software or Virus attack.
Technically,
This behavior was introduced in Windows XP SP2 because of the addition of the Attachment Execution Services (AES). Every program that is run by using the ShellExecute() API passes through AES. AES considers the downloaded update file to be from the Internet Zone. Therefore, AESdisplays the Open File - Security Warning dialog box. AES examines the file to see whether the file has a file stream of the type Zone.Identifier. Then AES determines what zone the file is from and what level of protection to apply when the file is run.
You can use the below code to suppress this message for your application to work fine.
set oShell= CreateObject("Wscript.Shell")
set oEnv = oShell.Environment("PROCESS")
oEnv("SEE_MASK_NOZONECHECKS") = 1
<Your Code here>
oEnv.Remove("SEE_MASK_NOZONECHECKS")
Please note that you should not set this as a permanent environment variable as it will disable all Zone Checking and it is not recommended.
VB Script to check for Microsoft Office 2003 and Word 2007
I had written this script to check the presence of MS Office 2003 and Word 2007 on a machine before proceeding for installation. Here is the code:
officepath11= sProgramFilesDir & "\Microsoft Office\Office11\"
officepath12= sProgramFilesDir & "\Microsoft Office\Office12\"
'set File System Object
set fso=createobject("scripting.filesystemobject")
'Check if file exists for Office 2003 and if yes then its version
path11 = fso.GetAbsolutePathName("C:\Program Files (x86)\Microsoft Office\Office11\winword.exe")
if (fso.FileExists(path11)) then
returnstring11=fso.getfileversion(officepath11 & "winword.exe")
else
returnstring11="Null"
end if
'Check if file exists for Word 2007 and if yes then its version
path12 = fso.GetAbsolutePathName("C:\Program Files (x86)\Microsoft Office\Office12\winword.exe")
if (fso.FileExists(path12)) then
returnstring12=fso.getfileversion(officepath12 & "winword.exe")
else
returnstring12="Null"
end if
arr11=split(returnstring11,".")
arr12=split(returnstring12,".")
if (arr11(0)="11" AND arr12(0)="12") then
'msgbox "Office 2003 and word 2007 both are installed, continue with script below"
else
if (arr11(0)="11" AND arr12(0)="Null") then
msgbox "Please install Word 2007 before installing this application"
WScript.Quit
else
if (arr11(0)="Null" AND arr12(0)="12") then
msgbox "Please install Office 2003 before installing this application"
WScript.Quit
else
if (arr11(0)="Null" AND arr12(0)="Null") then
msgbox "Please install Office 2003 and Word 2007 before installing this application"
WScript.Quit
end if
end if
end if
end if
set fso=nothing
officepath11= sProgramFilesDir & "\Microsoft Office\Office11\"
officepath12= sProgramFilesDir & "\Microsoft Office\Office12\"
'set File System Object
set fso=createobject("scripting.filesystemobject")
'Check if file exists for Office 2003 and if yes then its version
path11 = fso.GetAbsolutePathName("C:\Program Files (x86)\Microsoft Office\Office11\winword.exe")
if (fso.FileExists(path11)) then
returnstring11=fso.getfileversion(officepath11 & "winword.exe")
else
returnstring11="Null"
end if
'Check if file exists for Word 2007 and if yes then its version
path12 = fso.GetAbsolutePathName("C:\Program Files (x86)\Microsoft Office\Office12\winword.exe")
if (fso.FileExists(path12)) then
returnstring12=fso.getfileversion(officepath12 & "winword.exe")
else
returnstring12="Null"
end if
arr11=split(returnstring11,".")
arr12=split(returnstring12,".")
if (arr11(0)="11" AND arr12(0)="12") then
'msgbox "Office 2003 and word 2007 both are installed, continue with script below"
else
if (arr11(0)="11" AND arr12(0)="Null") then
msgbox "Please install Word 2007 before installing this application"
WScript.Quit
else
if (arr11(0)="Null" AND arr12(0)="12") then
msgbox "Please install Office 2003 before installing this application"
WScript.Quit
else
if (arr11(0)="Null" AND arr12(0)="Null") then
msgbox "Please install Office 2003 and Word 2007 before installing this application"
WScript.Quit
end if
end if
end if
end if
set fso=nothing
Wednesday, August 10, 2011
Issues while launching and closing of App-V shortcuts
While launching your App-V shortcut, if you notice that the buffering launch on bottom right says 100% but the
launch does not disappear as per normal behaviour then you need to do some modification in your osd file.
This possible is a cause if your application is Java related. You need to modify the Subsystem value in your osd
file.
By default the osd file has this:
<subsystem VALUE = "windows"/>
You need to change this value to
<subsystem VALUE = "console"/>
If you face a similar problem while closing the application or your application does not close completely, then
you need to again tweek your osd file.
By default you have following in your OSD file:
<virtualenv TERMINATECHILDREN="FALSE">
You need to change the value as below:
<virtualenv TERMINATECHILDREN="TRUE">
This will terminate the any child application which is associated with this application and will help to shut
your application down.
launch does not disappear as per normal behaviour then you need to do some modification in your osd file.
This possible is a cause if your application is Java related. You need to modify the Subsystem value in your osd
file.
By default the osd file has this:
<subsystem VALUE = "windows"/>
You need to change this value to
<subsystem VALUE = "console"/>
If you face a similar problem while closing the application or your application does not close completely, then
you need to again tweek your osd file.
By default you have following in your OSD file:
<virtualenv TERMINATECHILDREN="FALSE">
You need to change the value as below:
<virtualenv TERMINATECHILDREN="TRUE">
This will terminate the any child application which is associated with this application and will help to shut
your application down.
Wednesday, July 27, 2011
Application Virtualization
New technologies, new ways of working is changing our everyday environment.
Application Virtualization is the hot topic these days with Windows 7 coming in picture and organizations across
the globe are integrating App-V in their portfolio of delivery mechanism.
It has been quite some time now that I started work on App-V but did not get a chance to post things on my blog
as my blog was primarily focussed on MSI. I have finally decided to post App-V posts as well on my blog from now
onwards. There are lots of issues we face in everyday work regarding the technology and we try to lookup for
solutions on internet. As a cliche: If someone has already invented the wheel, there is no point re-inventing it.
The sole purpose of my blog is to help others with whatever I learn. I have got numerous solutions for problems
which I have faced and I really thank all those who had posted their solutions on net. This blog is just my way
to contribute back to the society.
All you people out there, please help by commenting, voting, propagating and sharing my blog with your friends
and collegues but with due credit and acknowledgement to the material posted here with my name and blog url as I
still do hold the copyright of the posts here.
Thanks all for your support.
Piyush
Application Virtualization is the hot topic these days with Windows 7 coming in picture and organizations across
the globe are integrating App-V in their portfolio of delivery mechanism.
It has been quite some time now that I started work on App-V but did not get a chance to post things on my blog
as my blog was primarily focussed on MSI. I have finally decided to post App-V posts as well on my blog from now
onwards. There are lots of issues we face in everyday work regarding the technology and we try to lookup for
solutions on internet. As a cliche: If someone has already invented the wheel, there is no point re-inventing it.
The sole purpose of my blog is to help others with whatever I learn. I have got numerous solutions for problems
which I have faced and I really thank all those who had posted their solutions on net. This blog is just my way
to contribute back to the society.
All you people out there, please help by commenting, voting, propagating and sharing my blog with your friends
and collegues but with due credit and acknowledgement to the material posted here with my name and blog url as I
still do hold the copyright of the posts here.
Thanks all for your support.
Piyush
Sunday, July 24, 2011
How to correctly display icons
The primary key of the ICON table should have the extension as .exe or .ico, else the icon will not display properly.
For example if the extension is abc.js then the same javascript icon will be shown in this case. If it is .txt then notepad icon will be displayed. Whatever be there in the [Binary], that does not matter if there is any other extension apart from .exe or .ico
For example if the extension is abc.js then the same javascript icon will be shown in this case. If it is .txt then notepad icon will be displayed. Whatever be there in the [Binary], that does not matter if there is any other extension apart from .exe or .ico
Sunday, July 17, 2011
What's New in Windows Installer 5.0
And want to keep a post for the latest version as well:
Well detailed in MSDN and here is the link:
http://msdn.microsoft.com/en-us/library/dd408114(v=vs.85).aspx
Well detailed in MSDN and here is the link:
http://msdn.microsoft.com/en-us/library/dd408114(v=vs.85).aspx
New Properties in Windows Installer 4.0 and later
Found this very useful post in msiblogger.com and would like to keep a note for myself so posting it here. Thanks to msiblogger for this.
Microsoft has released Windows Installer Service 4.0 with Windows Vista. This new version of msi engine introduces some new properties which are exclusively available to msi based installations targeted for Windows Vista & later.
MSIARPSETTINGSIDENTIFIER – The MSIARPSETTINGSIDENTIFIER property contains a semi-colon delimited list of the registry locations where the application stores a user’s settings and preferences. During an operating system upgrade, this information can be used by the setup to improve the experience of users migrating applications.
MsiLogging – This property can be used to enable automatic logging within the msi package. This propety value can be set to MSI logging parameters within the property table. Some valid values of this property would be: iwe, iwearcmpvo. Setting this property is the same as running your msi package with the /l option to create a log file. Note:You cannot use the “+” and “*” values of the /L option in the property value.
MsiLogFileLocation – This read/write property can be used to specify the name and location of the log file created by the MsiLogging Property. Not setting this property will automatically create a log file in the user’s temp location, the value of which will be set to this property.
MsiSystemRebootPending – This property is set to 1 if the target system has a pending reboot. This property can be used by setup in a launch condition to determine if a reboot is pending on the system.
MsiRunningElevated – This property is set to 1 if the msi package is being run with elevated privileges. This property is similar to using the Privileges property in msi 3.1 and earlier.
MSIRESTARTMANAGERCONTROL - This property enables setup authors to specify whether the package will use the Restart Manager or FileInUse Dialog to handle locked files at installation time.
The default value of this property is ‘0’, which forces the setup to interact with Restart Manager in case a locked file is encountered by the msi package.
Setting this property to ‘Disable’ will force the msi package to use FileInUse Dialog instead.
This property can also be set to “DisableShutDown”, which will mitigate Restart Manager’s ability to restart the machine in case of a reboot being triggered by the windows installer package. Using this property however does not disable Restart Manager from identifying files locked by applications and displaying the Restart Manager dialog.
MsiRestartManagerSessionKey - This value of this property is set to the Restart Manager session by the Microsoft installer.
MSIDISABLERMRESTART – This property is used to determine how applications and services that have locked files that need to be updated, will be handled after the update.
Setting this property to ‘0’ will force all the services that were shut down during an update to be restarted and applications registered with the Restart Manager to be restarted after the update.
Setting this property to ‘1’ will force all the processes (services & applications) that were shutdown during an update to not be restarted.
MSIRMSHUTDOWN – This property is used to determine how applications and services that are using files affected by an update should be handled during an update.
Setting this property to ‘0’ will cause all the processes using files affected by the update to be shut down.
Setting this property to ‘1’ will force all the processes using files affected by the update to be shutdown even if they don’t respond to Restart Manager.
Setting this property to ‘2’ will cause the processes using files affected by the update to be shutdown only if they are registered to be restarted by the Restart Manager. If any process is not registered for a restart, then it will not be shut down.
MSIUSEREALADMINDETECTION – Setting this property to 1 will request the installer to use the actual user information when setting the AdminUser property.
Microsoft has released Windows Installer Service 4.0 with Windows Vista. This new version of msi engine introduces some new properties which are exclusively available to msi based installations targeted for Windows Vista & later.
MSIARPSETTINGSIDENTIFIER – The MSIARPSETTINGSIDENTIFIER property contains a semi-colon delimited list of the registry locations where the application stores a user’s settings and preferences. During an operating system upgrade, this information can be used by the setup to improve the experience of users migrating applications.
MsiLogging – This property can be used to enable automatic logging within the msi package. This propety value can be set to MSI logging parameters within the property table. Some valid values of this property would be: iwe, iwearcmpvo. Setting this property is the same as running your msi package with the /l option to create a log file. Note:You cannot use the “+” and “*” values of the /L option in the property value.
MsiLogFileLocation – This read/write property can be used to specify the name and location of the log file created by the MsiLogging Property. Not setting this property will automatically create a log file in the user’s temp location, the value of which will be set to this property.
MsiSystemRebootPending – This property is set to 1 if the target system has a pending reboot. This property can be used by setup in a launch condition to determine if a reboot is pending on the system.
MsiRunningElevated – This property is set to 1 if the msi package is being run with elevated privileges. This property is similar to using the Privileges property in msi 3.1 and earlier.
MSIRESTARTMANAGERCONTROL - This property enables setup authors to specify whether the package will use the Restart Manager or FileInUse Dialog to handle locked files at installation time.
The default value of this property is ‘0’, which forces the setup to interact with Restart Manager in case a locked file is encountered by the msi package.
Setting this property to ‘Disable’ will force the msi package to use FileInUse Dialog instead.
This property can also be set to “DisableShutDown”, which will mitigate Restart Manager’s ability to restart the machine in case of a reboot being triggered by the windows installer package. Using this property however does not disable Restart Manager from identifying files locked by applications and displaying the Restart Manager dialog.
MsiRestartManagerSessionKey - This value of this property is set to the Restart Manager session by the Microsoft installer.
MSIDISABLERMRESTART – This property is used to determine how applications and services that have locked files that need to be updated, will be handled after the update.
Setting this property to ‘0’ will force all the services that were shut down during an update to be restarted and applications registered with the Restart Manager to be restarted after the update.
Setting this property to ‘1’ will force all the processes (services & applications) that were shutdown during an update to not be restarted.
MSIRMSHUTDOWN – This property is used to determine how applications and services that are using files affected by an update should be handled during an update.
Setting this property to ‘0’ will cause all the processes using files affected by the update to be shut down.
Setting this property to ‘1’ will force all the processes using files affected by the update to be shutdown even if they don’t respond to Restart Manager.
Setting this property to ‘2’ will cause the processes using files affected by the update to be shutdown only if they are registered to be restarted by the Restart Manager. If any process is not registered for a restart, then it will not be shut down.
MSIUSEREALADMINDETECTION – Setting this property to 1 will request the installer to use the actual user information when setting the AdminUser property.
Sunday, July 03, 2011
Windows 7 Language Pack Installation and Un-Installation on 32 bit and 64 bit Machines
Recently I had to package Window 7 MUI for around 13 languages, both for 32 bit and 64 bit machines. I could not get any complete documentation for Installing, Un-Installing and making it work with the Deployment tool.
I thought to write this article so it reduces the work of people who still have to make Language packs as a package.
Windows 7 Language Packs come in a DVD and generally have a cab file called, lp.cab for all the languages in their respective folders.
Following are the main command lines to be used while installing and Un-installing the Language Packs:
Installation:
dism /online /add-package /quiet /norestart /packagepath:lp.cab
and
Un-Installation:
dism /online /remove-package /quiet /norestart /packagepath:lp.cab
The lp.cab file can be copied to a temp location by your MSI and then a setup.bat file would be required to run the above command line.
I had copied lp.cab, setup.bat,setup.vbs, uninstall.bat and uninstall.vbs to “%windir%\temp\” folder.
Here are the uses of all these files and how they are related in MSI.
Lp.cab: This is the basic installer cab file of the language pack which you can get through the source or DVD
Setup.bat: This is the batch file to install the language pack as per the above command line.
Setup.vbs: This .vbs file locally calls the setup.bat file, as if you are deploying from Deployment tool/network location then the batch file throws an error as it cannot resolve the UNC paths.
Uninstall.bat: This is the batch file to un-install the language pack using the above mentioned command line.
Uninstall.vbs: This .vbs file locally calls the uninstall.bat file, as if you are deploying from Deployment tool/network location then the batch file throws an error as it cannot resolve the UNC paths. Also this when wrapped in MSI, you can un-install the package from Add/Remove Programs and the language pack can be un-installed.
After creating and adding these files to a temporary location, you can add 2 custom Actions, one for install and other for un-install to run the vbs files from installed filed.
The Installation Custom Action can be placed just before InstallFinalize with condition as NOT REMOVE, and the Un-Installation Custom Action can be placed just after InstallInitialize with condition as REMOVE.
Now since you have read this from Packaging perspective this goes well for both 32 bit and 64 bit machines. But if now you try to install this MSI from Deployment tool or any other deployment tool which uses system account to run, you will face an issue with the 64 bit machines.
The reason for not working in 64-bit machines is that when the MSI is run in system account all the scripts/batch file are run through cmd.exe which is in c:\windows\syswow64 folder. This does not work for dism command line and I had to use a workaround for this issue.
The work around is that you need to run the dism command from %windir%\Sysnative.
This works fine and I have inserted the below line in the batch file for both install and un-install before running the dism installation command:
cd %windir%\sysnative
So the batch file looks like:
Install:
@echo off
cd %windir%\sysnative
dism /online /add-package /quiet /norestart /packagepath:%windir%\temp\Microsoft_Win7MUI_Arabicx64 \lp.cab
Uninstall:
@echo off
cd %windir%\sysnative
dism /online /remove-package /quiet /norestart /packagepath:%windir%\temp\Microsoft_Win7MUI_Arabicx64 \lp.cab
I hope all this information will be helpful for you to create the language packs. It took me a week to figure these things out. Hope you will not face this difficulty.
I thought to write this article so it reduces the work of people who still have to make Language packs as a package.
Windows 7 Language Packs come in a DVD and generally have a cab file called, lp.cab for all the languages in their respective folders.
Following are the main command lines to be used while installing and Un-installing the Language Packs:
Installation:
dism /online /add-package /quiet /norestart /packagepath:lp.cab
and
Un-Installation:
dism /online /remove-package /quiet /norestart /packagepath:lp.cab
The lp.cab file can be copied to a temp location by your MSI and then a setup.bat file would be required to run the above command line.
I had copied lp.cab, setup.bat,setup.vbs, uninstall.bat and uninstall.vbs to “%windir%\temp\
Here are the uses of all these files and how they are related in MSI.
Lp.cab: This is the basic installer cab file of the language pack which you can get through the source or DVD
Setup.bat: This is the batch file to install the language pack as per the above command line.
Setup.vbs: This .vbs file locally calls the setup.bat file, as if you are deploying from Deployment tool/network location then the batch file throws an error as it cannot resolve the UNC paths.
Uninstall.bat: This is the batch file to un-install the language pack using the above mentioned command line.
Uninstall.vbs: This .vbs file locally calls the uninstall.bat file, as if you are deploying from Deployment tool/network location then the batch file throws an error as it cannot resolve the UNC paths. Also this when wrapped in MSI, you can un-install the package from Add/Remove Programs and the language pack can be un-installed.
After creating and adding these files to a temporary location, you can add 2 custom Actions, one for install and other for un-install to run the vbs files from installed filed.
The Installation Custom Action can be placed just before InstallFinalize with condition as NOT REMOVE, and the Un-Installation Custom Action can be placed just after InstallInitialize with condition as REMOVE.
Now since you have read this from Packaging perspective this goes well for both 32 bit and 64 bit machines. But if now you try to install this MSI from Deployment tool or any other deployment tool which uses system account to run, you will face an issue with the 64 bit machines.
The reason for not working in 64-bit machines is that when the MSI is run in system account all the scripts/batch file are run through cmd.exe which is in c:\windows\syswow64 folder. This does not work for dism command line and I had to use a workaround for this issue.
The work around is that you need to run the dism command from %windir%\Sysnative.
This works fine and I have inserted the below line in the batch file for both install and un-install before running the dism installation command:
cd %windir%\sysnative
So the batch file looks like:
Install:
@echo off
cd %windir%\sysnative
dism /online /add-package /quiet /norestart /packagepath:%windir%\temp\Microsoft_Win7MUI_Arabicx64 \lp.cab
Uninstall:
@echo off
cd %windir%\sysnative
dism /online /remove-package /quiet /norestart /packagepath:%windir%\temp\Microsoft_Win7MUI_Arabicx64 \lp.cab
I hope all this information will be helpful for you to create the language packs. It took me a week to figure these things out. Hope you will not face this difficulty.
Context Menu Creation for gVIM application in x64 machine
I was stuck in an application where I had to use the 32 bit source for both 32 and 64 bit machines. The application seemed to work fine, except the context menu option in x64 machines.
I found a great post by David Vielmetter on his blog http://davidvielmetter.com/tricks/context-menu-issues-with-gvim-in-windows-7-x64/ and I was able to solve the issue. I think context menu many times create an issue in 64 bit machines and this is a good way to solve them (This is entirely my point of view). If someone has some better suggestions, they are most welcome to comment here. I too would like to learn more on how to create 64 bit context menu options.
I found a great post by David Vielmetter on his blog http://davidvielmetter.com/tricks/context-menu-issues-with-gvim-in-windows-7-x64/ and I was able to solve the issue. I think context menu many times create an issue in 64 bit machines and this is a good way to solve them (This is entirely my point of view). If someone has some better suggestions, they are most welcome to comment here. I too would like to learn more on how to create 64 bit context menu options.
Wednesday, June 22, 2011
Context Menu for WinMerge appliction in x64
WinMerge application has the same source for x86 and x64 machines.
The application works fine when packaged in MSI for x86, but the same application will not work on x64 as the context menu option will not be visible. To get the context menu option, follow these steps:
1) Install the source on 64 bit machine and from INSTALLDIR, copy the ShellExtensionx64.dll file.
2) Register this Dll file and keep its registry information in a reg file.
3) The 32 bit version of this ShellExtension is ShellExtensionU.dll, hence make the component of this .dll conditionalized to be installed only on 32 bit machines. For this you can write the Condition as: (VersionNT32)
4) Create a 64 bit component and import ShellExtensionx64.dll and its registry in it. The condition to make this component install only in 64 bit machines is: (VersionNT64)
5) Also keep in mind to launch the application before taking a second snapshot of the application. This will include some HKCU registry keys which go in HKCU\Software\Thingamahoochie\WinMerge
This is important as a registry is created in this hive, ContextMenuEnabled=1, which enables the context menu in the application.
The application works fine when packaged in MSI for x86, but the same application will not work on x64 as the context menu option will not be visible. To get the context menu option, follow these steps:
1) Install the source on 64 bit machine and from INSTALLDIR, copy the ShellExtensionx64.dll file.
2) Register this Dll file and keep its registry information in a reg file.
3) The 32 bit version of this ShellExtension is ShellExtensionU.dll, hence make the component of this .dll conditionalized to be installed only on 32 bit machines. For this you can write the Condition as: (VersionNT32)
4) Create a 64 bit component and import ShellExtensionx64.dll and its registry in it. The condition to make this component install only in 64 bit machines is: (VersionNT64)
5) Also keep in mind to launch the application before taking a second snapshot of the application. This will include some HKCU registry keys which go in HKCU\Software\Thingamahoochie\WinMerge
This is important as a registry is created in this hive, ContextMenuEnabled=1, which enables the context menu in the application.
Subscribe to:
Posts (Atom)