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
Why I Am... "Autodesk University"
23 hours ago
No comments:
Post a Comment