Automatically Set Shared .dll Attribute

Automatically Set Shared .dll Attribute

January 21, 2001

by John Loomes

This WISE for Windows Installer macro will set the shared .dll attribute on all files within Windows, Windows\System32 or Winnt, Winnt\system32 every time you Save your MSI package.

Setting this attribute is necessary in order to provide backwards compatability with non-MSI based applications, and can take a LONG time to do manually, for a larger applications.

Note: Because of the way in which MSI stores Directories, this macros cant handle file in application specific subdirectories of WINNT\Windows. However, applications that do this should be few and far between so this macro should solve MOST of your problems....

To use the macro: paste the code below into your WISE macro file (default is Wise For Windows Installer\templates\Macros.wbs. It is then activated for use within MSI packages you create in WISE.

This macro has been tested sucessfully on Windows 2000, but as usual I accept NO responsibility for the results you get by using it!


Sub WFWIEvents_Save(strPathname)

Dim tblComponent
Dim rowComponent
Dim strDirectory

Dim strWindows
Set tblComponent = WTables("Component")
For Each rowComponent In tblComponent.WRows
StrWindows = rowComponent("Directory_")
StrWindows = Left(strWindows,12)
If strWindows = "SystemFolder" Or strWindows = "WindowsFolde" Then
rowComponent("Attributes") = CInt(rowComponent("Attributes")) Or 8
End If

End Sub