Table of Contents

Autodesk DWG TrueView 2017

By — adlerweb 2015/03/24

Update — TheNavy 2016/04/28

Start the Setup and wait for the extraction to complete. Copy the folder generated at c:\Autodesk to CLIENT_DATA. Only 64 Bit is implemented. The Setup will install several prerequirements, these are not removed in delsup.ins. For < = Windows 8 .NET Framework 4 must be added as a feature before running the setup.

Tree:

* delsub.ins
* DWGTrueView_2017_Enu_64bit
* dwgtrueview.png
* setup.ins
* uninstall.ins

setup.ins

[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $ExitCode$
DefVar $INST_SystemType$
DefVar $UninstallCommand$
DefVar $MsiId$
DefVar $DisplayName$
 
Set $INST_SystemType$ = GetSystemType
 
Set $ProductId$       = "dwgtrueview"
Set $MinimumSpace$    = "2000 MB"
 
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
	LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
	isFatalError
	; Stop process and set installation status to failed
else
	if (($INST_SystemType$ = "x86 System"))
		LogError "32 Bit is not supported for " + $ProductId$
		isFatalError
		; Stop process and set installation status to failed
	else
 
		comment "Show product picture"
		ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
 
		if FileExists("%ScriptPath%\delsub.ins")
			comment "Start uninstall sub section"
			Sub "%ScriptPath%\delsub.ins"
		endif
 
		comment "installing"
 
		Message "Installing " + $ProductId$ + " 64 Bit..."
		comment "Start setup program"
		Winbatch_install
		Sub_check_exitcode
	endif
endif
 
[Winbatch_install]
 "%ScriptPath%\DWGTrueView_2017_Enu_64bit\Setup.exe" /w /t /l /qb setup.ini
; Note: This will show a process-bar with cancel-button
; You can replace /qb with /q to hide the process dialog alltogether
; /qb- to remove only the cancel button doesn't seem to work
 
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
	comment "Looks good: setup program gives exitcode zero"
else
	comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
	if ($ExitCode$ = "1605")
		comment "ERROR_UNKNOWN_PRODUCT	1605	This action is only valid for products that are currently installed."
		comment "Uninstall of a not installed product failed - no problem"
	else
		if ($ExitCode$ = "1641")
			comment "looks good: setup program gives exitcode 1641"
			comment "ERROR_SUCCESS_REBOOT_INITIATED	1641	The installer has initiated a restart. This message is indicative of a success."
		else
			if ($ExitCode$ = "3010")
				comment "looks good: setup program gives exitcode 3010"
				comment "ERROR_SUCCESS_REBOOT_REQUIRED	3010	A restart is required to complete the install. This message is indicative of a success."
			else
				logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
				isFatalError
			endif
		endif
	endif
endif

uninstall.ins

[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $ExitCode$
DefVar $ProductId$
DefVar $INST_SystemType$
DefVar $UninstallCommand$
DefVar $MsiId$
DefVar $DisplayName$
 
Set $INST_SystemType$ = GetSystemType
 
Set $ProductId$       = "dwgtrueview"
 
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
 
Message "Uninstalling " + $ProductId$ + " ..."
 
if FileExists("%ScriptPath%\delsub.ins")
	comment "Start uninstall sub section"
	Sub "%ScriptPath%\delsub.ins"
endif

delsub.ins

; 2015
set $MsiId$ = "{5783F2D7-E028-0409-0100-0060B0CE6BBA}"
set $DisplayName$ = GetRegistryStringValue64 ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiId$+"] DisplayVersion")
if not ($DisplayName$ = "")
	set $UninstallCommand$ = "MsiExec.exe /X"+$MsiId$+" /qb! REBOOT=ReallySuppress"
	Message "Found "+$ProductId$+" "+$DisplayName$+" => uninstalling"
	Comment "Command: "+$UninstallCommand$
	Winbatch_uninstall
	sub_check_exitcode
endif
 
; 2016
set $MsiId$ = "{5783F2D7-F028-0409-0100-0060B0CE6BBA}"
set $DisplayName$ = GetRegistryStringValue64 ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiId$+"] DisplayVersion")
if not ($DisplayName$ = "")
	set $UninstallCommand$ = "MsiExec.exe /X"+$MsiId$+" /qb! REBOOT=ReallySuppress"
	Message "Found "+$ProductId$+" "+$DisplayName$+" => uninstalling"
	Comment "Command: "+$UninstallCommand$
	Winbatch_uninstall
	sub_check_exitcode
endif
 
; 2017
set $MsiId$ = "{28B89EEF-0028-0409-0100-CF3F3A09B77D}"
set $DisplayName$ = GetRegistryStringValue64 ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiId$+"] DisplayVersion")
if not ($DisplayName$ = "")
	set $UninstallCommand$ = "MsiExec.exe /X"+$MsiId$+" /qb! REBOOT=ReallySuppress"
	Message "Found "+$ProductId$+" "+$DisplayName$+" => uninstalling"
	Comment "Command: "+$UninstallCommand$
	Winbatch_uninstall
	sub_check_exitcode
endif
 
[Winbatch_uninstall]
 $UninstallCommand$
 
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
	comment "Looks good: setup program gives exitcode zero"
else
	comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
	if ($ExitCode$ = "1605")
		comment "ERROR_UNKNOWN_PRODUCT	1605	This action is only valid for products that are currently installed."
		comment "Uninstall of a not installed product failed - no problem"
	else
		if ($ExitCode$ = "1641")
			comment "looks good: setup program gives exitcode 1641"
			comment "ERROR_SUCCESS_REBOOT_INITIATED	1641	The installer has initiated a restart. This message is indicative of a success."
		else
			if ($ExitCode$ = "3010")
				comment "looks good: setup program gives exitcode 3010"
				comment "ERROR_SUCCESS_REBOOT_REQUIRED	3010	A restart is required to complete the install. This message is indicative of a success."
			else
				logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
				isFatalError
			endif
		endif
	endif
endif