Showing posts with label MSI. Show all posts
Showing posts with label MSI. Show all posts

Wednesday, May 15, 2013

Packaging Skype with Auto Update disabled

EDITED: I have edited this post on 30-Aug-2013 after some users comments that the given solution is not working. I have studied in depth the skype update process and created this solution for all. Please check below (Edited Section) for more information.

Recently while packaging Skype for enterprise version, I could not disable the Auto Updates and finally found a way to get rid of it.

You can get the latest version of Skype setup in MSI format from the following URL: http://download.skype.com/msi/SkypeSetup.msi or
http://www.skype.com/go/getskype-msi


There is no registry, file which can disable the Auto Update functionality of Skype. I searched in lots of forums and all said that it automatically prompts for update. So finally I decided to look in the MSI and find why and how it is doing it.

What I found was that Skype has an Updater.exe in the installation folder and it also creates a Skype Update service which points to this exe.
I just removed this service and updater.exe file from the skype msi package and it worked.
No need to do anything else. Just do this small part and you are done with removing the Auto Update in Skype.

Edited:
I have been asked and told by a lot of users that this is not working so I am adding a further solution which will definitely work without a doubt. I have mass deployed this and it has worked fine. For all the users who were getting the pop ups, this has fixed it.

You need to create a dummy SetupSkype.exe file and a Skypefix.vbs as below and add it to your INSTALLDIR (C:\Program Files\Skype\Phone\) of the package.

SkypeFix.vbs:
'==============================================
dim filesys, oShell
Set filesys = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")

des1 = oShell.ExpandEnvironmentStrings ("%Temp%")
sup = oShell.ExpandEnvironmentStrings ("%ProgramFiles%")
windir = oShell.ExpandEnvironmentStrings ("%Windir%")

destfile1= des1 & "\SkypeSetup.exe"
sourcefile1= sup & "\Skype\Phone\SkypeSetup.exe"

'Copy files

If filesys.FileExists(sourcefile1) Then

 a= filesys.CopyFile (sourcefile1, destfile1,True)

End If

oShell.Run windir & "\System32\Icacls.exe " & destfile1 & " /deny Everyone:D"

'=================================================

After this you need to create an Active Setup registry key which will run this vbs file for every user who logs off and logs in. After this there will be no upgrade issue.

This script works on the fact that SkypeSetup.exe gets downloaded from internet to %temp% folder of user and when it is downloaded, it starts prompting up for upgrade. I have created this file before hand in %temp% folder or replace the already existing one with this dummy file and then put a deny restriction to all the users on this file. So now a file cannot be downloaded to %temp% folder because there is already a file which cannot be deleted/replaced. Hence no more upgrade prompts.
I have created this solution by deeper understanding of Skype setup and upgrade.

Hope this tip will be helpful to you and let me know if it still does not work.

Tuesday, October 23, 2012

Install MSP file with MSI

While handling with MSP of applications, sometimes a question comes in mind that can an MSP be installed along with MSI?
The answer is yes, but with a few conditions involved.
The conditions are explained later in the post with some description.

First I will give you the command line to install MSP along with MSI:

msiexec /i {Path to MSI}\Installer.MSI PATCH={Path to MSP}\Patch.MSP /qb

If there is a transform as well to add you can include it in the command line as well.

msiexec /i {Path to MSI}\Installer.MSI TRANSFORMS={Path to Transform}\Transform.MST PATCH={Path to MSP}\Patch.MSP /qb

The only thing which you have to take care in the command line is that you will have to give a complete path to MSP.
Relative paths do not work in this case.

This will apply the patch as in the updated files will be installed from the patch rather than from the MSI.

This process is greatly useful when there are a lot of patches to be applied to an MSI.

There might be cases that the MSI is already deployed on your client machines and you need to patch it with this new patch which has come now. You can deploy the MSP over the MSI and then it is suggested to change the initial MSI package to include the MSP.

If you have multiple MSP for an MSI then the way you implement it actually depends on the way the MSP are created for the MSI. There are two kinds of MSP:
1) Incremental
2) Add-on

The above ones are my terms and not Microsoft's and I am using them just for explaination purpose.

In Incremental MSP, say version 1.2 contains all the content for version 1.1 and so can be installed directly on top of MSI which is version 1.0. Similarly version 1.3 will install directly on top of MSI version 1.0. So you can skip the previous MSP version and directly install the latest version on top of your MSI.

In Add-on MSP, the MSP has only additional data from the previous version of MSI or MSP. For example, say version 1.2 has a few files added but it does not contain the files/registries which were added or modified in version 1.1 of MSP. So in this case you will have to install both MSPs, version 1.1 and 1.2 one after the other on top of MSI version 1.0
You can use command line like this:
msiexec /i {Path to MSI}\Package_1.0.MSI PATCH={Path to MSP}\Patch_1.1.MSP; {Path to MSP}\Patch_1.2.MSP /qb

The order of MSP mentioned here is important as it will install in that particular order only.

I hope this article is helpful to you in organizing and maintaining your Operational work with Application Packaging.

Wednesday, September 26, 2012

Error installing MSI from USB/DVD


I faced an issue installing Flash player from USB drive though it was installing fine when installed from local or network drive. I found out the issue and resolution and want to document here for all of you.

While installing the package, I got this error in the log files:

 

MSI (s) (44:C4) [14:06:35:318]: Source is incorrect. Volume label should be  but is SMSBOOT.

MSI (s) (44:C4) [14:06:46:956]: Source is incorrect. Volume label should be  but is SMSBOOT.

 

While analysing this, I realized that the disk label for my USB is SMSBOOT and this could be anything else for you on your USB or DVD.

I had added a file in my MSI through MST and it had created an entry in the Media table. This entry looked like this and this is the default entry which you get with the tool.

 
 

Behind the scene it was looking for a Blank labelled disk where this media is located but could not find it and it gave an error “Insert Disk”.

I removed the label from my USB drive and kept it Blank. It worked fine.

Just to get this you can do the following in your packages so that this issue does not come.

Just add DISK1 in the VolumeLabel Column for your added media as well. This will make it work for any labelled USB or DVD drive.
 
 

I hope this will help you to resolve your issues.

Wednesday, June 13, 2012

Re-Packaging Apple Quicktime 7.72.80.56 and later versions

Quicktime comes as an EXE file which can be extracted easily with 7Zip. The three MSI I received were AppleApplicationSupport, AppleSoftwareUpdate and Quicktime. The Apple Update MSI can be discarded if you do not want to AutoUpdate your Quicktime.

Apple Application Support MSI can be directly installed with /qb! switch.

iTunes can be packaged separately and I have created a separate post for its customization:
http://msiworld.blogspot.com.au/2012/06/re-packaging-apple-itunes-10617-and.html

Quicktime should be modified through Transform as follows:

1) Change the following properties in your MST:

 SCHEDULE_ASUW =0
  REGSRCH_DESKTOP_SHORTCUTS =0
 REBOOT=ReallySuppress

2) Install Quicktime on a test machine and do all the customizations you want with preferences. Once all customizations are complete, copy the quicktime.qtp file from "%userprofile%\AppData\LocalLow\Apple Computer\QuickTime\QuickTime.qtp"

Add this file to Transform in C:\ProgramData\Apple Computer\QuickTime\QuickTime.qtp.

Now add these two scripts in your package in Custom Action to run just before Install Finalize and with Condition as NOT REMOVE~="ALL"

a) This script will copy the .qtp file to all the users profile.
----------------------------------------------------------------------
'Created by Piyush Nasa
'Used to copy the config file to the current user\appdata\local directory.
on error resume next
Set oShell = CreateObject( "WScript.Shell" )
userprofile=oShell.ExpandEnvironmentStrings("%USERPROFILE%")
systemdrive=oShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%")
Set fso = CreateObject("Scripting.FileSystemObject")
Set afile = fso.GetFile(systemdrive & "\ProgramData\Apple Computer\QuickTime\QuickTime.qtp")
strDestination1 =userprofile & "\AppData\LocalLow\Apple Computer\QuickTime\QuickTime.qtp"

fso.CreateFolder(userprofile & "\Application Data\LocalLow\Apple Computer")
fso.CreateFolder(userprofile & "\Application Data\LocalLow\Apple Computer\QuickTime")
afile.Copy(strDestination1)
------------------------------------------------------------------------
b) This script will create the registry key for every user.
------------------------------------------------------------------------
'Created by Piyush Nasa
'Used to create HKCU registry to point to qtp file.
Option Explicit
Dim Temp
'HKEY_CURRENT_USER = HKCU
'HKEY_LOCAL_MACHINE = HKLM
'HKEY_CLASSES_ROOT = HKCR
'HKEY_USERS = HKEY_USERS
'HKEY_CURRENT_CONFIG = HKEY_CURRENT_CONFIG
Temp = WriteReg("HKCU\Software\Apple Computer, Inc.\QuickTime\LocalUserPreferences\FolderPath","%userprofile%\AppData\LocalLow\Apple Computer\QuickTime\","REG_SZ")

Function WriteReg(RegPath, Value, RegType)
       'Regtype should be "REG_SZ" for string, "REG_DWORD" for a integer,…
       '"REG_BINARY" for a binary or boolean, and "REG_EXPAND_SZ" for an expandable string
       Dim objRegistry, Key
       Set objRegistry = CreateObject("Wscript.shell")
      Key = objRegistry.RegWrite(RegPath, Value, RegType)
       WriteReg = Key
End Function
---------------------------------------------------------------------------

3) Add any HKCU registry key in a new component placed at the highest parent Feature. Set this as a keypath. This will ensure that the application is self healed when launched by the user.

4) You will have to remove a Launch condition to check if the existing version is installed already, because I faced a problem and it was not uninstalling properly too with that condition being there. Though this step is optional.

Please note that this package works fine when deployed/installed through any deployment tool in System context as it will trigger the self heal. If you have to manually install this application then you need to add the file the LOCALAPPDATAFOLDER manually in your transform.

Hope this will expidite your packaging of Quicktime application.

Re-Packaging Apple iTunes 10.6.1.7 and later

iTunes comes as an EXE file which can be extracted easily with 7Zip. The five MSI I received were AppleApplicationSupport, AppleMobileDeviceSupport64, AppleSoftwareUpdate, Bonjour64 and iTunes64. The Apple Software Update MSI and Bonjour MSI can be discarded if you do not want to AutoUpdate your iTunes. Bonjour can be kept if you want to allow file sharing on your desktop fleet. We did not want this so we removed this MSI. If you want to install Bonjour then it can be installed silently with /qb! switch.

From this Version QuickTime is not part of iTunes. QuickTime can be packaged separately. more details for packaging this is in this post:
http://msiworld.blogspot.com.au/2012/06/re-packaging-apple-quicktime-7728056.html

Apple Application Support and Apple Mobile Device Support MSI can be installed silently with /qb! switch.

You will have to customize iTunes by creating an MST file.

1) Change the following Public Properties in the MST:
DESKTOP_SHORTCUTS = 0
DISABLEADVTSHORTCUTS = 0
SCHEDULE_ASUW = 0
AMDS_IS_INSTALLED = 1
BONJOUR_IS_INSTALLED = 1
REBOOT = ReallySuppress
NO_ASUW = 0
NO_BONJOUR = 0
IAcceptLicense = Yes
REGSRCH_DESKTOP_SHORTCUTS = 0

2) Install iTunes on a test machine and make all the customizations you want. All the customizations will be stored in following files:

a) "%userprofile%\AppData\Local\Apple Computer\iTunes\cache.db
b) "%userprofile%\AppData\Local\Apple Computer\iTunes\iTunesPrefs.xml"
c) "%userprofile%\AppData\Roaming\Apple Computer\iTunes\iTunesPrefs.xml"
d) "%userprofile%\AppData\Roaming\Apple Computer\iTunes\Preferences\com.apple.iTunes.plist"
e) "%userprofile%\AppData\Roaming\Apple Computer\iTunes\Preferences\keychain.plist"

Copy these files in C:\ProgramData\Apple Computer\iTunes\ folder in your MST file and then use the below script to run in Custom Action just before InstallFinalize. Condition to be kept as NOT REMOVE~="ALL"


'Created by Piyush Nasa
'Used to copy the config file to the current user\appdata\local directory.
on error resume next
Set oShell = CreateObject( "WScript.Shell" )
userprofile=oShell.ExpandEnvironmentStrings("%USERPROFILE%")
systemdrive=oShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%")
Set fso = CreateObject("Scripting.FileSystemObject")
Set afile = fso.GetFile(systemdrive & "\ProgramData\Apple iTunes\local\cache.db")
strDestination1 =userprofile & "\AppData\Local\Apple Computer\iTunes\cache.db"
Set bfile = fso.GetFile(systemdrive & "\ProgramData\Apple iTunes\local\iTunesPrefs.xml")
strDestination2 =userprofile & "\AppData\Local\Apple Computer\iTunes\iTunesPrefs.xml"
Set cfile = fso.GetFile(systemdrive & "\ProgramData\Apple iTunes\Roaming\iTunesPrefs.xml")
strDestination3 =userprofile & "\AppData\Roaming\Apple Computer\iTunes\iTunesPrefs.xml"
Set dfile = fso.GetFile(systemdrive & "\ProgramData\Apple iTunes\Roaming\Preferences\com.apple.iTunes.plist")
strDestination4 =userprofile & "\AppData\Roaming\Apple Computer\iTunes\Preferences\com.apple.iTunes.plist"
Set efile = fso.GetFile(systemdrive & "\ProgramData\Apple iTunes\Roaming\Preferences\keychain.plist")
strDestination5 =userprofile & "\AppData\Roaming\Apple Computer\iTunes\Preferences\keychain.plist"

fso.CreateFolder(userprofile & "\AppData\Local\Apple Computer")
fso.CreateFolder(userprofile & "\AppData\Local\Apple Computer\iTunes")
fso.CreateFolder(userprofile & "\AppData\Roaming\Apple Computer")
fso.CreateFolder(userprofile & "\AppData\Roaming\Apple Computer\iTunes")
fso.CreateFolder(userprofile & "\AppData\Roaming\Apple Computer\iTunes\Preferences")
afile.Copy(strDestination1)
bfile.Copy(strDestination2)
cfile.Copy(strDestination3)
dfile.Copy(strDestination4)
efile.Copy(strDestination5)

3) Add any HKCU registry key in a new component placed at the highest parent Feature. Set this as a keypath. This will ensure that the application is self healed when launched by the user.

Please note that this package works fine when deployed/installed through any deployment tool in System context as it will trigger the self heal. If you have to manually install this application then you need to add the file the LOCALAPPDATAFOLDER manually in your transform.

Hope this will expidite your packaging of iTunes application.

Wednesday, February 22, 2012

How to make an MSI with some files compressed in Cabinet file and other uncompressed outside the MSI

This is a very interesting feature in MSI and I would like to explore and explain this for your knowledge and benefit.

Word Count generally known as Word Count Summary property. This is a mandatory Summary property in MSI and can be changed from your WSI. Please note that this property is not in Property table but is in Summary table.
This property has a different meaning for MSI, Transforms and Patch.
This property is a bit feild.
There are 4 bits which can be set or unset as in 0 or 1. eg. 01
Here is the description for these bits:
---------------------------------------------------------------------------------
Bit 0
0 Long file names.
1 Short file names.

---------------------------------------------------------------------------------
Bit 1
0 Source is uncompressed.
2 Source is compressed.

---------------------------------------------------------------------------------
Bit 2
0 Source is original media.
4 Source is a administrative image created by an administrative installation.
---------------------------------------------------------------------------------
Bit 3
0 Elevated privileges can be required to install this package.
8 Elevated privileges are not required to install this package.

Available starting with Windows Installer version 4.0 and Windows Vista or
Windows Server 2008.
---------------------------------------------------------------------------------

Here is what you get when you combine these values:

Value=0
means Original source is using long file names. Matches tree in Directory
Table. Elevated privileges can be required to install this package.

Value=1 means Original source is using short file names. The file structure
Matches tree in Directory Table. Elevated privileges can be required to install
this package.

Value=2 means Compressed source files using long file names. Matches cabinets and
files in the Media Table. Elevated privileges can be required to install this
package.

Value=3 means Compressed source files using short file names. Matches cabinets
and files in the Media Table. Elevated privileges can be required to install this
package.

Value=4 means you are installing an Administrative image using long file names.
Matches tree in Directory Table. Elevated privileges can be required to install
this package.

Value=5 means you are installing an Administrative image using short file names.
Matches tree in Directory Table. Elevated privileges can be required to install
this package.

Value=8
means Elevated privileges are not required to install this package. Use
this value when Authoring Packages without the UAC Dialog Box.
Available starting with Windows Installer version 4.0 and Windows Vista or
Windows Server 2008.

Now if you set the Bit 1 which means that the package is marked as compressed,
the Windows Installer only installs files located at the root of the source and
not in the tree like directory structure. In this case even the files marked as
Uncompressed in the File table must be located at the root of the source
directory of your MSI so that they can be installed.
Now to make a package that has both a cab file (compressed files) and
uncompressed files that match the tree in Directory table, you need to mark the
package as uncompressed by leaving bit 1 unset, that is a value of 0 in the Word
Count Summary Property and then you need to set the File Attribute to compressed
file (value of 16384 to be added to the current value of file attribute) in the
attribute column of file table for each file which is in Cabinet file.

Transforms:

In Transform you should not try and experiment with this property because in
Transforms this property should be always Null.
Patches:
In Patches the value of this property determines the minimum Windows Installer
version required to install the patch.
Value=1 which is the default value, means that MSPATCH was used to create the
Patch
Value=2 means a minimum version of Windows Installer 1.2 is required for patch to
be applied.
Value=3 means a minimum version of Windows Installer 2.0 is required for patch to
be applied.
Value=4 means a minimum version of Windows Installer 3.0 is required for patch to
be applied.
Value=5 means a minimum version of Windows Installer 3.1 is required for patch to
be applied.

Hope this new information will be helpful to you in designing your MSI in a
better way

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)
  1. VS2010_Uninstall-RTM.ENU.exe
  2. Dfusrprf.xml
  3. User.vbs
  4. Arpsuppress64.reg
  5. Arpsuppress32.reg
  6. Arpsuppresswow64.reg
  7. ConfigurationFile.ini
  8. Setup.vbs
  9. Uninstall.vbs
  10. Uninstall.bat
These files are the complete list of files which will do the trick to install and un-install the MS Visual Studio 2010 package.
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:
Use the following content for this file:
<?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.

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

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.

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.

Monday, November 24, 2008

Different Ways of Giving Permissions in Your Windows Installer

Windows XP/Windows 7 works under a locked down environment in most organisations. The MSI authors generally have to provide permissions to the installation directory, so that the users without admin rights are able to access and write data into the installation directory.
When you set permissions, you are specifying what level of access the user has to the folder and its files and what users can do within that folder such as save, delete, or read files.
If you would like to know how to set permissions through Powershell Script, then I would recommend you to read my new blog entry here:
http://msiworld.blogspot.com/2012/01/my-first-powershell-script.html

There are six standard permission types which apply to files and folders in Windows XP/Windows 7:



  • Full Control


  • Modify


  • Read & Execute


  • List Folder Contents


  • Read


  • Write

  • Each level represents a different set of actions users can perform. See the table below for more information.

    For folders you can also set your own unique permissions or create a variation of any of the standard permission levels. Within each of the permission levels are many possible variations.

    The following table represents the available standard permission types with their descriptions:

    Full Control - Permits the user(s) to:



  • view file name and subfolders


  • navigate to subfolders


  • view data in the folder's files


  • add files and subfolders to the folder


  • change the folder's files


  • delete the folder and its files


  • change permissions


  • take ownership of the folder and its files

  • Modify - Permits the user(s) to:


  • view the file names and subfolders


  • navigate to subfolders


  • view data in the folder's files


  • add files and subfolders to the folder


  • change the folder's files


  • delete the folder and its files

  • Read & Execute - Permits the user(s) to:


  • view file names and subfolder names


  • navigate to subfolders


  • view data in the folder's files


  • add files and subfolders to the folder

  • List Folder Contents - Permits the user(s) to:


  • view folders


  • navigate to subfolders


  • view folders


  • does not permit access to the folder's files

  • Read - Permits the user(s) to:


  • view the file names and subfolder names


  • navigate to subfolders


  • run applications


  • open files


  • copy and view data in the folder's files

  • Write - The Read permissions, plus permits the user(s) to:


  • create folders


  • add new files


  • open and change files


  • delete files


  • You can set permission to folders in following ways:


  • Secedit


  • XCACLS/ICACLS


  • LockPermission table.

  • Full Control - Permits the user(s) to:


  • view file name and subfolders


  • navigate to subfolders


  • view data in the folder's files


  • add files and subfolders to the folder


  • change the folder's files


  • delete the folder and its files


  • change permissions


  • take ownership of the folder and its files

  • Modify - Permits the user(s) to:


  • view the file names and subfolders


  • navigate to subfolders


  • view data in the folder's files


  • add files and subfolders to the folder


  • change the folder's files


  • delete the folder and its files

  • Read & Execute - Permits the user(s) to:


  • view file names and subfolder names


  • navigate to subfolders


  • view data in the folder's files


  • add files and subfolders to the folder

  • List Folder Contents - Permits the user(s) to:


  • view folders


  • navigate to subfolders


  • view folders


  • does not permit access to the folder's files

  • Read - Permits the user(s) to:


  • view the file names and subfolder names


  • navigate to subfolders


  • run applications


  • open files


  • copy and view data in the folder's files

  • Write - The Read permissions, plus permits the user(s) to:


  • create folders


  • add new files


  • open and change files


  • delete files

  • You can set permission to folders in following ways:


  • Secedit


  • XCACLS/ICACLS


  • LockPermission table.

  • SECEDIT:

    SECEDIT command-line tool can be used to impose group policy object settings upon a target workstation immediately.
    To use Secedit to give permission in your package, perform the following steps:
    Go to Run and type MMC.
    A Console will open up as shown in the below picture.
    Go to File -> and click on Add / Remove Snap in.



    The Add / Remove Snap in window opens up as shown in the below picture.



    After this Click on Add...
    Add standalone Snap in console opens up as shown in the below picture.



    Choose Security Template from the list of Snap in, and click on Add.
    The Security template will be added to the console.
    You can see the File System, with all the listed directories on the right. This is shown in below picture.



    Now, delete all files on right.
    Right click and click on Add File, browse and select the required directory to give permission to.
    Similarly you can give permission to registry too.



    Now, delete all files on right.
    Right click and click on Add File, browse and select the required directory to give permission to.
    Similarly you can give permission to registry too.



    Click on OK and save this template as .inf (such as {PackageName}.inf) file.
    Now we have to include this file in the package.
    Add this file to %Windir%\security\templates folder.
    Use the following Custom Action in your package to implement Secedit.

    Use Execute Program from Destination Custom Action.


  • Give Custom Action name as per your standards


  • Working Directory to be set is Templates folder (where we have placed the .inf file.


  • In exe and Command line give the following command:
    secedit /configure /db "[security]Database\{PackageName}.sdb" /cfg "[security]templates\{PackageName}.inf" /log "[security]logs\{PackageName}.log" /quiet
    
    
    Here [security] refers to the security folder is C:\Windows or %Windir%\Security. It is always good to use directory instead of hardcoded paths.

    {PackageName} refers to the name you would like to give to your .inf file, to your log file you create and to the .sdb file you create.

    Note that this will create .sdb file in %windir%\security\Database folder and .log file in %windir%\security\logs folder. So while un-installation of package you need to remember to delete these files from the folder. You can do that by using remove file table.



  • The location of the Custom action should be just before install finalize.


  • The Condition for launch of Custom Action should be "NOT REMOVE"


  • The Custom action can be run in deferred mode in system context.

  • XCACLS/ICACLS:

    XCACLS or Extended Change Access Control List tool, is an advanced version of CACLS, the difference being that we do not have to answer Yes/No prompts in XCACLS. CACLS and XCACLS are tools which are used to modify the ACLs (Access Control Lists), by which in turn we are modifying the folder permissions for users in windows. ICACLS is another tool like XCACLS.

    CACLS is installed in all users machine in System32 folder.

    XCACLS ships with the Windows NT Resource Kit or can be easily downloaded from net. XCACLS allows you to set permissions to the same granular level of control that you have with the GUI.

    CACLS Syntax

    CACLS filename [/T] [/E] [/C] [/G user:perm] [/R user [...]] [/P user:perm [...]] [/D user [...]]

    filename Displays ACLs.
    /T Changes ACLs of specified files in the current directory and all subdirectories.
    /E Edit ACL instead of replacing it.
    /C Continue on access denied errors.
    /G user:perm Grant specified user access rights.
    Perm can be:
    R Read
    C Change (write)
    F Full control
    /R user Revoke specified user's access rights (only valid with /E).
    /P user:perm Replace specified user's access rights.
    Perm can be:
    N None
    R Read
    C Change (write)
    F Full control
    /D user Deny specified user access.


    Wildcards can be used to specify more that one file in a command.
    You can specify more than one user in a command.

    XCACLS Syntax

    XCACLS filename [/T] [/E] [/C] [/G user:perm;spec] [/R user [...]][/P user:perm;spec [...]] [/D user [...]] [/Y]
    
    

    filename Displays ACLs.
    /T Changes ACLs of specified files in the current directory and all subdirectories.
    /E Edit ACL instead of replacing it.
    /C Continue on access denied errors.
    /G user:perm;spec Grant specified user access rights.
    Perm can be:
    R Read
    C Change (write)
    F Full control
    P Change Permissions (Special access)
    O Take Ownership (Special access)
    X EXecute (Special access)
    E REad (Special access)
    W Write (Special access)
    D Delete (Special access)
    Spec can be the same as perm and will only be applied to a directory. In this case, Perm will be used for file inheritence in this directory. If not omitted: Spec=Perm. Special values for Spec only:
    T NoT Specified (for file inherit, only for dirs valid)
    At least one access right has to follow!
    Entries between ';' and T will be ignored!
    /R user Revoke specified user's access rights.
    /P user:perm;spec Replace specified user's access rights.
    for access right specification see /G option
    /D user Deny specified user access.
    /Y Replace user's rights without verify


    Wildcards can be used to specify more that one file in a command.
    You can specify more than one user in a command.
    You can combine access rights.

    Example of XCACLS can be:
    xcacls "[INSTALLDIR]FOLDER" /e /g users:ewxd;ewx
    

    Usage for ICACLS

    ICACLS "[INSTALLDIR]FOLDER" /T /grant USERS:M

    LockPermission table:

    LockPermission table can be also used to give permission to files, folders and registries.
    With the help of Lockpermission table you can give permission to only those users who already exist on the computer or domain.
    For giving permission through LockPermission table follow the below procedure:
    On the File section in Installation expert (You can do the same with Registry too) , Either go to file or the directory (depending on to which you want to give permission) and click on Details. There will be a permission tab there. For giving permission to file you will get the below screen where there will be a permissions tab among other tabs as shown in the picture. If you have chosen directory then there will only be a permissions tab. Click on Add. In the domain, you can mention the domain of the user for which permissions are to be set. You can either give a standalone machine or a domain name. I have used an environment variable here [%USERDOMAIN] which will pick the domain at run time for the user for which the package is being installed. The user which you can set can be Administrator, Everyone or Logged on User. I have selected every one here.



    After that you can select the permissions from below what all permissions you want to give to the user. Click ok and the permissions work is over.

    Now when you go to the LockPermissions table in Tables section, you can see the following columns there:

    Lock Object, Table, Domain, User and permission.

    Lock Object and Table column together specify the file, directory or registry key to be given permission to. Lock Object contains the name of the file, directory or the registry name. Table column can be filled with File, Create Folder or Registry. Lock Object is the foreign key to the primary key of Table mentioned by Table column.

    Domain as I have mentioned earlier is the domain of the user.
    User too as I have mentioned earlier is the User to whom we want to give the permission.
    Permission is the Generic number to the permissions we have specified.

    Every file, registry key, or directory that is listed in the LockPermissions Table receives an explicit security descriptor, whether it replaces an existing object or not. The Windows Installer attempts to preserve the security on objects that already exist on the system. If an object is not listed in the LockPermissions Table, and replaces an existing object, the replacement gets the security settings of the object that it replaces.

    If an object is not listed in the LockPermissions Table, and does not replace an existing object, it receives no explicit security descriptor. The access to the new object is based on the attributes of its parent or container object. If an object is not listed in the table, and replaces an object with no explicit security descriptor, the access to the new object is based on the attributes of its parent or container object.

    Hope this article helps you to builds up your knowledge on how to give permissions to your files, folders and registries.

    Tuesday, November 18, 2008

    Required Properties in MSI

    There are five properties which are required by every Microsoft installer to identify itself from other MSI.

    These properties are required to be present in every MSI.

    These are the five properties:

    1) Product Name: It is the name of the application you mention in your MSI.
    2) Product version: This is the version of the product which you give.. like 1.0.0 etc..
    3) Product code: It is the unique GUID for your MSI.
    4) Product language: This is the numeric value of product and should be one of those entries mentioned in Template summary property in Summary information stream.
    5) Manufacturer: This is the name of the manufacturer of the product.
    For future upgrades, it is recommended to add Upgrade code property in the package.

    Thursday, October 30, 2008

    Difference Between Self Heal and Repair

    Self Heal and Repair are two different concepts in Windows Installer which people many times consider to be the same thing, however there is difference in these two.

    Self Heal is triggered by advertised shortcuts, or other advertising information in the package which eventually Repairs the application.

    When the application is launched by advertised shortcut, it checks for all the key paths of the Current Feature, if any of the key paths is missing it will launch Repair.

    Note that if there are multiple features then it will not check the missing key paths of the other features, but only the feature of which the advertised shortcut is launched.

    Repair of an MSI can be triggered by

    Repair button in Add/Remove programs
    Giving the command line msiexec /f{other option} {MSI name}
    Self Heal by advertised shortcut or other advertising information.
    Active setup
    Once the repair of the package is triggered, even with Self Heal, then the whole of the MSI is reinstalled. Then it does not see that only the feature which triggered the self heal should be repaired, but the whole MSI, by which I mean, all its features are reinstalled.

    Hope this clarifies the difference between two.

    Tuesday, October 21, 2008

    How REINSTALLMODE=amus Works

    In any of these installation transactions, viz. initial installation, repair, reinstallation, on-demand installation or patching an MSI, The REINSTALLMODE has an affect on it.

    Here is what "amus" means:

    * a - Force all files to be reinstalled, regardless of version
    * m - Rewrite all registry keys that go to HKEY_LOCAL_MACHINE or HKEY_CLASSES_ROOT
    * u - Rewrite all registry keys that go to HKEY_CURRENT_USER or HKEY_USERS
    * s - Reinstall shortcuts and icons

    The mentioning of "a" in amus forces the reinstallation of files on your machine irrespective of the file version rules. Every file updated by REINSTALL property will be updated in this case.

    The sequence of events which happen actually depend on the authoring of your patch.

    If your patch contains the full file, the installer will not access the source to reinstall that file, but if your file is the delta of the file, like an update to say ini file, then the patch will access first the machine file and update it, and if machine file is not accessible to the patch, then in that case, the installer will go and grab the file from the original source location and will work from there.

    REINSTALLMODE=amus is not the recommended solution, but sometimes situations become inevitable and we need to use them.

    Monday, October 13, 2008

    Using SOURCEDIR Property in Package

    SOURCEDIR property in MSI package refers to the location from where the MSI is installed in the machine. How do we use this property in our package.

    If you want to use a file which is kept in the source folder (next to where your MSI is placed), through Custom Action then you need to follow this procedure.

    The SOURCEDIR cannot be directly used in the package. If you read the logs then SOURCEDIR property is created and correctly pointed to the directory. But later the log shows that: Deleting SOURCEDIR... So the value of this property is deleted and the MSI does not get access to it. If you display message with [SOURCEDIR] property then it will be empty.

    The work around for this is that we can put an Action in the sequence called: "ResolveSource" after CostFinalize action. Then if you place your Custom Action after this action which refers to SOURCEDIR property then you will get the correct value of SOURCEDIR.

    Acknowledgement: I would like to thank my friend, Anurag, here who helped me to figure this out.... :)

    Isolation of a File: Two Ways in One MSI

    Generally you would have read that after isolation is done, we should not modify the MSI. So how to do .local and .manifest in the same MSI. Actually you would be thinking: "What is the need to do both types in the same MSI?" This is because, recently, I came across a situation in which we needed to do isolation of a file for installation of application in Windows 2000 through .local method and for installation in Windows XP and Vista through .manifest method. This was needed to be done through same MSI.

    This is the solution. Create a .msi file with .local isolation method for windows 2000. Then create another .msi file with .manifest isolation. Note the visual difference of .manifest isolation file and the base MSI. Make all the differences seen in this to the .msi which was created with .local isolation. Then compile it. This will not get corrupted. Only the ones with .manifest isolation if recompiled again get corrupted. So take care of this and you can then conditionalize the components to be installed for 2000, XP or Vista...

    Friday, October 10, 2008

    How to Create Packages with a Size Greater Than 2 GB

    Packages which need to include or which capture files with a total size exceeding 2 GB, it's necessary to use some tricks. Usually the MSI with cabs compressed outside the MSI allows the maximum size of cab files to be 2 GB. If the cab size file tries to exceed 2 GB, then the WISE package compilation throws an error.

    For this you need to create separate features. In these separate features, distribute the files in the package so that the feature has a total file size of less than 2 GB.

    After this you need to go to Media option in Installation expert and choose option one cab file per feature.

    This will give you the MSI along with cab files which have size less than 2 GB.

    Since the total package size will be very big, the downloading of cab files while deploying and then uncompressing them, will take lots of time. So the other solution is to choose the option of Uncompressed Files outside MSI in the media option. This will save time during installation.

    Tuesday, September 09, 2008

    Using VBScript to Set Properties in MSI

    We can easily use Set Property Custom Action to set Windows Installer Property, but sometimes we wish to set the property directly in VbScript, specially if we are taking an input from a user through VBScript. Hope this tip helps.

    To set property through VBScript we can use "Session" object like:

    Session.Property("ALLUSERS")="1"

    or we can directly use Property keyword like:

    Property("REBOOT")="ReallySuppress"

    The only catch here is that we cannot set INSTALLDIR property through the above method as the package uses Directory table to store the value of INSTALLDIR. We need to write the below VBScript to set INSTALLDIR:

    dim instpath

    instpath = "C:\newpath\newfolder"

    Session.TargetPath("INSTALLDIR")=instpath

    Remember to place this Custom Action after CostFinalize if you are changing the value of INSTALLDIR property in UI Sequence.

    Monday, August 18, 2008

    Troubleshooting Unnecessary Repairs

    Sometimes you may encounter the problem of unnecessary repairs of MSI while launching the shortcut in the same logged in user. Here is the way to troubleshoot this problem.
    You can go to eventviewr (by typing eventvwr in Run command) then to applications and check the latest error message after repair. It will tell you which component is missing and because of which MSI went for self heal.
    You can now check out this component in your package and see what the problem is. Maybe your keypath is a moving target for that component.

    There are other methods too which can be used in case the above does not work. These are Logs/Gap capture.

    More on this later.