Changeset 3725
- Timestamp:
- Nov 22, 2019, 4:19:01 PM (5 years ago)
- Location:
- trunk/src/netlabs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/netlabs/bin/defaults.cfg ¶
r3623 r3725 264 264 \NEPMD\User\Encoding\EditCmdBefore = 0 265 265 266 ; Check NEPMD Version 267 \NEPMD\User\VersionCheck\CheckUrl = ftp://ftp.netlabs.org/pub/nepmd/version.cfg 268 266 269 ; Spell check dictionaries 267 270 ; %u = URL spec -
TabularUnified trunk/src/netlabs/macros/stdctrl.e ¶
r3689 r3725 1858 1858 fQuery = 1 1859 1859 endif 1860 --dprintf( 'CheckNepmdVersion: fQuery = 'fQuery) 1860 1861 1861 1862 if fQuery then … … 1864 1865 call EditNepmdVersionLine( 'Checking for new version...') 1865 1866 1866 CheckFileUrl = 'ftp://ftp.netlabs.org/pub/nepmd/version.cfg'1867 1867 WgetCmd = '' 1868 1868 do once2 = 1 to 1 … … 1872 1872 endif 1873 1873 1874 p1 = lastpos( '/', CheckFileUrl) 1875 Name = substr( CheckFileUrl, p1 + 1) 1874 KeyPathCheckUrl = '\NEPMD\User\VersionCheck\CheckUrl' 1875 CheckUrl = QueryConfigKey( KeyPathCheckUrl) 1876 p1 = lastpos( '/', CheckUrl) 1877 Name = substr( CheckUrl, p1 + 1) 1876 1878 TmpFile = GetTmpPath()''Name 1877 1879 EnqTmpFile = EnquoteFileSpec( TmpFile) … … 1880 1882 endif 1881 1883 1882 WgetCmd = 'wget -T 2 -t 1 "'Check FileUrl'" -O 'EnqTmpFile1884 WgetCmd = 'wget -T 2 -t 1 "'CheckUrl'" -O 'EnqTmpFile 1883 1885 EpmCmd = "start epm /r 'postme VersionParseTmpFile "EnqTmpFile CurDate CurTime"'" 1884 1886 … … 1902 1904 insertline 'do 1' 1903 1905 insertline ' '''WgetCmd'''' 1904 insertline ' if rc <> 0 then'1905 insertline ' leave'1906 --insertline ' if rc <> 0 then' 1907 --insertline ' leave' 1906 1908 insertline ' "'EpmCmd'"' 1907 1909 insertline 'end' … … 1913 1915 1914 1916 -- Execute CmdFile 1917 --dprintf( 'CmdFile = 'CmdFile', WgetCmd = 'WgetCmd) 1915 1918 'postme os2 /c /min 'CmdFile 1916 1919 enddo … … 1936 1939 Date = '' 1937 1940 Url = '' 1941 CheckResult = 1 1938 1942 1939 1943 getfileid tmpfid, TmpFile … … 1990 1994 call DeleteFile( TmpFile) 1991 1995 1992 CheckResult = 01993 1996 KeyPath = '\NEPMD\Var\VersionCheck' 1994 1997 1995 -- 1998 -- Save as last check data to ini 1996 1999 call WriteConfigKey( KeyPath'\Version', Version) 1997 2000 call WriteConfigKey( KeyPath'\ReleaseDate', Date) … … 2001 2004 call WriteConfigKey( KeyPath'\CheckDateTime', CurDate CurTime) 2002 2005 2003 -- Change CheckResult to 0 (success) 2004 CheckResult = 0 2006 if Version = '' then 2007 elseif Date = '' then 2008 elseif Url = '' then 2009 else 2010 -- Change CheckResult to 0 (success) 2011 CheckResult = 0 2012 endif 2005 2013 call WriteConfigKey( KeyPath'\Result', CheckResult) 2006 2014 … … 2014 2022 do once = 1 to 1 2015 2023 KeyPath = '\NEPMD\Var\VersionCheck' 2016 2017 CheckResult = QueryConfigKey( KeyPath'\Result') 2018 Version = QueryConfigKey( KeyPath'\Version') 2019 ReleaseDateTime = QueryConfigKey( KeyPath'\ReleaseDateTime') 2020 Url = QueryConfigKey( KeyPath'\Url') 2021 CheckDateTime = QueryConfigKey( KeyPath'\CheckDateTime') 2024 CheckResult = QueryConfigKey( KeyPath'\Result') 2025 Version = QueryConfigKey( KeyPath'\Version') 2026 ReleaseDate = QueryConfigKey( KeyPath'\ReleaseDate') 2027 Url = QueryConfigKey( KeyPath'\Url') 2028 CheckDateTime = QueryConfigKey( KeyPath'\CheckDateTime') 2029 2030 KeyPathCheckUrl = '\NEPMD\User\VersionCheck\CheckUrl' 2031 CheckUrl = QueryConfigKey( KeyPathCheckUrl) 2032 --dprintf( 'EditNepmdVersionResult: CheckResult = 'CheckResult', Version = 'Version', NepmdVersion = 'GetNepmdVersion()', ReleaseDate = 'ReleaseDate', CheckDateTime = 'CheckDateTime) 2022 2033 2023 2034 CheckedOn = '(checked on 'CheckDateTime')' 2024 if Url = '' then 2035 if CheckResult <> 0 then 2036 Text = 'Connection failed: 'CheckUrl CheckedOn 2037 elseif Url = '' then 2025 2038 Text = 'Check failed, URL is missing' 2026 elseif CheckResult <> 0 then2027 Text = 'Connection failed: 'Url CheckedOn2028 2039 else 2029 2040 if Version = GetNepmdVersion() then
Note:
See TracChangeset
for help on using the changeset viewer.