QuickWho

Check-in [bc281c51cf]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Cleanup of software update
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bc281c51cf917a5faf6dbafba0b32cdcc951c483
User & Date: kevin 2016-04-08 04:07:05
Context
2016-04-08
04:10
Minor adjustments of XML file check-in: 9aaae89d46 user: kevin tags: trunk
04:07
Cleanup of software update check-in: bc281c51cf user: kevin tags: trunk
03:08
Fix bug in Mac build script check-in: d84a922071 user: kevin tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to scriptlibs/softwareupdate/softwareupdate.tcl.

94
95
96
97
98
99
100


101












102
103
104
105
106
107
108
	    if {![package vsatisfies $hostOS $minOS]} {
		tk_messageBox -icon warning -message "Error!" -detail "$appname is not supported on Mac OS X $hostOS. The minimum supported OS version is $minOS." 
		return
	    }
	}
	
	if {[expr $currentversion < $versionnumber]} {


	    softwareupdate::updatePitch












	} else {
	    softwareupdate::upToDate
	}
    }

#define the current version of the software
proc setVersion {app number} {







>
>

>
>
>
>
>
>
>
>
>
>
>
>







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
	    if {![package vsatisfies $hostOS $minOS]} {
		tk_messageBox -icon warning -message "Error!" -detail "$appname is not supported on Mac OS X $hostOS. The minimum supported OS version is $minOS." 
		return
	    }
	}
	
	if {[expr $currentversion < $versionnumber]} {
	    switch [tk windowingsystem] {
		"aqua" {
	    softwareupdate::updatePitch

		}
		
		"win32" {
		    softwareupdate::winPitch $appname $currentversion $oldversion
		}
		
		"x11" {
		    
		}
	    }
	    
	} else {
	    softwareupdate::upToDate
	}
    }

#define the current version of the software
proc setVersion {app number} {
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
		bgerror $msg
		tk_messageBox -icon warning -message "Error!" -detail "An error occurred in the installation of $appname. Please try again later."
		return
	    } else {

		file rename -force $currentinstall [file join /Users [exec whoami] .Trash [file tail $currentinstall]]

		file rename -force /tmp/$appname.app $currentinstall

		exec $currentinstall/Contents/MacOS/$appname &

		exit
	    }
	}
	
	"win32" {
	    
	    softwareupdate::writeBatch $appname
	    eval exec [auto_execok start]  /b "" cmd /c [file join $tmpdir deleteapp.bat] &
	}
	
	"x11" {
	    tk_messageBox -icon info -parent . -message "Please ask the maintainer of $appname on your platform to prepare a release of the latest version."
	    return
	}
    }

    catch {destroy .downloadprogress}

    

}


proc writeBatch {appname} {

    variable tmpdir
    variable currentinstall

    set script {
	cd  $currentinstall 
	taskkill /IM $appname.exe /F
	rename $appname.exe ${appname}-tmp.exe 
	cd $tmpdir
	copy [file nativename [file join $tmpdir $appname.exe]] [file nativename [file join $currentinstall $appname.exe]]
	cd $currentinstall
	start $appname.exe
	del ${appname}-tmp.exe
	cd $tmpdir
	::del deleteapp.bat
    }

    set batchscript [subst $script]
    set delscript [open [file join $tmpdir deleteapp.bat] w]
    puts $delscript $batchscript
    close $delscript


}

namespace export *

}







|









<
<


<
<
<
<









<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<



464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480


481
482




483
484
485
486
487
488
489
490
491


























492
493
494
		bgerror $msg
		tk_messageBox -icon warning -message "Error!" -detail "An error occurred in the installation of $appname. Please try again later."
		return
	    } else {

		file rename -force $currentinstall [file join /Users [exec whoami] .Trash [file tail $currentinstall]]

		    file rename -force $tmpdir/$appname.app $currentinstall

		exec $currentinstall/Contents/MacOS/$appname &

		exit
	    }
	}
	
	"win32" {
	    


	}
	




    }

    catch {destroy .downloadprogress}

    

}




























namespace export *

}