Thursday, July 27, 2006

Autodesk DWF Viewer 7.0 deployment tips & trix

Using VBScript (file with VBS extension) Autodesk DWF Viewer 7.0 can be installed and configured unattended or silently. One new thing with version 7.0 is that an MSI file that can be downloaded from www.autodesk.com/dwfviewer. Below are some tips & tricks that you can get ideas from.

By default, DWF Viewer checks for its latest version on the Autodesk Web site (Help > Check for Updates...). You can configure DWF Viewer to check for an update from another location, such as your company's Web site server, allowing you to control which version is available to your users. See the help file on Programming and Administration>Check for Updates from a Non-Autodesk Server.

To install:
on error resume next
Set WshShell = CreateObject("WScript.Shell")
' Progress bar without cancel button
WshShell.Run """\\server\DWF\7.0\DwfViewerSetup.msi"" /qb!",1,true


This could be done as a post installation:
on error resume next
Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")

' Delete the link from the start menu
key="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\" & _
  "CurrentVersion\Explorer\Shell Folders\"
path=WshShell.RegRead(key & "Common Programs") & "\Autodesk"
fso.DeleteFile path & "\Autodesk DWF Viewer.lnk",True

' Delete the folder from the start menu if it's empty
if FolderEmpty(path) then fso.DeleteFolder path, True

' Do not show dialog box asking for update if a newer version is available
key = "HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\" & _
  "DWF Viewer\Settings\AutoUpdate\DoNotShowAgain"
WshShell.RegWrite key, 1, "REG_DWORD"

' Do not check for a new version when starting DWF Viewer
key = "HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\" & _
  "DWF Viewer\Settings\AutoUpdate\InitialCheck"
WshShell.RegWrite key, 1, "REG_DWORD"

' Do not check that often (number in days)
key = "HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\" & _
  "DWF Viewer\Settings\AutoUpdate\CheckInterval"
WshShell.RegWrite key, 1000, "REG_DWORD"

' Make sure that if the user cannot update from the Help menu by pointing to an invalid location
key = "HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\" & _
  "DWF Viewer\Settings\AutoUpdate\URL"
WshShell.RegWrite key, "C:\", "REG_SZ"

' Use single click to follow hyperlinks
key = "HKEY_CURRENT_USER\Software\Autodesk\DWF Common\" & _
  "Preferences\User Interface\Single Click Hyperlink"
WshShell.RegWrite key, 1, "REG_DWORD"

' Suppress Getting started Page
key = "HKEY_CURRENT_USER\Software\Autodesk\DWF Common\" & _
  "Preferences\User Interface\Suppress Startup Page"
WshShell.RegWrite key, 1, "REG_DWORD"

Function FolderEmpty (path1)
  Set oFolder = fso.GetFolder(path1)
  Set oFiles = oFolder.Files
  flag = true
  For Each i in oFiles
    flag = false
  Next
  FolderEmpty = flag
End function


To uninstall:
on error resume next
Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
key="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\" & _
  "Uninstall\Autodesk DWF Viewer\UninstallString"
UninstallString=WshShell.RegRead(key)
if UninstallString<>"" then WshShell.Run "msiexec /x {9A346205-EA92-4406-B1AB-50379DA3F057} /qb!",1,true
                                                       

It is also possible to sidable some menu items in the Viewer by editing this file:
C:\Program Files\Autodesk\Autodesk DWF Viewer\EComposite\menubar_exe.htm

Here are some examples:

helpRegisterMenu.disabled = false; can be changed to helpRegisterMenu.disabled = true;

helpUpdateMenu.disabled = false; can be changed to helpUpdateMenu.disabled = true;

No comments:

Post a Comment