cbklib

Check-in [49a6b6157d]
Login

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

Overview
Comment:Update software update package
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:49a6b6157d2c07fc94657c3d105c5934f44246b3
User & Date: admin 2015-11-14 04:47:30
Context
2015-11-15
22:29
Update softwareupdate code check-in: 95ea150de6 user: admin tags: trunk
2015-11-14
04:47
Update software update package check-in: 49a6b6157d user: admin tags: trunk
2015-10-13
10:52
Final tweaks of registration, xplat check-in: 7dd496bd2c user: admin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to softwareupdate/softwareupdate.tcl.

270
271
272
273
274
275
276


277











278
279
280
281
282
283
284
...
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
...
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
    wm resizable .update 0 0
    wm deiconify .update
    raise .update
    wm transient .update .

}















#"busy" dialog
proc checkingForUpdates {} {

    variable appname
    variable icon

    catch {destroy .updateprogress}
................................................................................
		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
	}
    }
................................................................................
    

}


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 *

}







>
>
|
>
>
>
>
>
>
>
>
>
>
>







 







|
|
|







 







|
|

|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|







270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
...
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
...
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
513
    wm resizable .update 0 0
    wm deiconify .update
    raise .update
    wm transient .update .

}

proc winPitch {name newversion oldversion} {
    set answer [tk_messageBox  -icon info -title "New Version Available" -message "New Version Available" -detail "$name $newversion is available--you have $currentapp. Would you like to download it now?" -type yesno
	       ]

    switch -- $answer {
	yes {

	    xplat::launch http://www.codebykevin.com/$name.html
	}
	no {
	    return
	}
    }
}
#"busy" dialog
proc checkingForUpdates {} {

    variable appname
    variable icon

    catch {destroy .updateprogress}
................................................................................
		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
	}
    }
................................................................................
    

}


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 *

}