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 Side-by-Side Diffs Ignore Whitespace Patch

Changes to softwareupdate/softwareupdate.tcl.

   270    270       wm resizable .update 0 0
   271    271       wm deiconify .update
   272    272       raise .update
   273    273       wm transient .update .
   274    274   
   275    275   }
   276    276   
          277  +proc winPitch {name newversion oldversion} {
          278  +    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
          279  +	       ]
   277    280   
          281  +    switch -- $answer {
          282  +	yes {
          283  +
          284  +	    xplat::launch http://www.codebykevin.com/$name.html
          285  +	}
          286  +	no {
          287  +	    return
          288  +	}
          289  +    }
          290  +}
   278    291   #"busy" dialog
   279    292   proc checkingForUpdates {} {
   280    293   
   281    294       variable appname
   282    295       variable icon
   283    296   
   284    297       catch {destroy .updateprogress}
................................................................................
   447    460   		exec $currentinstall/Contents/MacOS/$appname &
   448    461   
   449    462   		exit
   450    463   	    }
   451    464   	}
   452    465   	
   453    466   	"win32" {
   454         -	  
   455         -	  softwareupdate::writeBatch $appname
   456         -	  eval exec [auto_execok start]  /b "" cmd /c [file join $tmpdir deleteapp.bat] &
          467  +	    
          468  +	    softwareupdate::writeBatch $appname
          469  +	    eval exec [auto_execok start]  /b "" cmd /c [file join $tmpdir deleteapp.bat] &
   457    470   	}
   458    471   	
   459    472   	"x11" {
   460    473   	    tk_messageBox -icon info -parent . -message "Please ask the maintainer of $appname on your platform to prepare a release of the latest version."
   461    474   	    return
   462    475   	}
   463    476       }
................................................................................
   467    480       
   468    481   
   469    482   }
   470    483   
   471    484   
   472    485   proc writeBatch {appname} {
   473    486   
   474         -variable tmpdir
   475         -variable currentinstall
          487  +    variable tmpdir
          488  +    variable currentinstall
   476    489   
   477         -set script {
   478         -cd  $currentinstall 
   479         -taskkill /IM $appname.exe /F
   480         -rename $appname.exe ${appname}-tmp.exe 
   481         -cd $tmpdir
   482         -copy [file nativename [file join $tmpdir $appname.exe]] [file nativename [file join $currentinstall $appname.exe]]
   483         -cd $currentinstall
   484         -start $appname.exe
   485         -del ${appname}-tmp.exe
   486         -cd $tmpdir
   487         -::del deleteapp.bat
   488         -}
          490  +    set script {
          491  +	cd  $currentinstall 
          492  +	taskkill /IM $appname.exe /F
          493  +	rename $appname.exe ${appname}-tmp.exe 
          494  +	cd $tmpdir
          495  +	copy [file nativename [file join $tmpdir $appname.exe]] [file nativename [file join $currentinstall $appname.exe]]
          496  +	cd $currentinstall
          497  +	start $appname.exe
          498  +	del ${appname}-tmp.exe
          499  +	cd $tmpdir
          500  +	::del deleteapp.bat
          501  +    }
   489    502   
   490         -set batchscript [subst $script]
   491         -set delscript [open [file join $tmpdir deleteapp.bat] w]
   492         -puts $delscript $batchscript
   493         -close $delscript
          503  +    set batchscript [subst $script]
          504  +    set delscript [open [file join $tmpdir deleteapp.bat] w]
          505  +    puts $delscript $batchscript
          506  +    close $delscript
   494    507   
   495    508   
   496    509   }
   497    510   
   498    511   namespace export *
   499    512   
   500    513   }