Automatically Set Shared .dll Attribute

By ServerWatch Staff (Send Email)
Posted Jan 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.

This WISE for Windows Installer macro will set the shared .dll attribute on all files within Windows, WindowsSystem32 or Winnt, Winntsystem32 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
Next

End Sub

Page 1 of 1


Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.