Saturday, January 7, 2006

Autodesk DWF Viewer deployment tips & trix

Using VBScript (file with VBS extension) Autodesk DWF Viewer can be installed and configured unattended or silently. Below are some tips & trix 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")
' /q2 is install without progress meter
' /q is install with progress meter
WshShell.Run """//server/DWF/6.5/DwfViewerSetup.exe"" /q",1,true


Here is something that 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 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
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
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 UninstallString & " /q",1,true

No comments:

Post a Comment

Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner

Contact Us | About JTB World | Website General Terms of Use | Privacy Policy
^ Top of page

© 2004- JTB World. All rights reserved.