Ignore:
Timestamp:
Mar 19, 2010 11:55:53 AM (13 years ago)
Author:
srkline
Message:

Tweaks for the installer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Installer/CheckVersionFTP.ipf

    r570 r644  
    22#pragma IgorVersion=6.1 
    33 
    4 // goes to our ftp site and downloads "CurrentVersion.txt" 
     4// goes to our ftp site and downloads "CurrentVersion.txt", puts this in "Packages" 
     5// in the WM preferences folder. I can write to it here, and it won't mess with any install 
    56// 
    67// compares to the installed version string, which is installed in UP:NCNR_UP 
     
    4041        fileNameStr = IgorPathStr + "User Procedures:NCNR_User_Procedures:InstalledVersion.txt" 
    4142         
     43        // the Igor 6.1 User Procedure Path, same sub-folders as in Igor App Folder 
     44        String userPathStr=RemoveEnding(SpecialDirPath("Igor Pro User Files",0,0,0),":")+":" 
     45         
     46        // try the UP folder in the Igor Pro folder (older installations) 
    4247        Open/R/Z refNum as fileNameStr 
    4348        if(V_flag != 0) 
    44                 //couldn't find the file, send user to web site to update 
    45                 sprintf str,"I could not determine what version of the SANS Macros you are running." 
     49                //then try the special user directory (for 6.1+ installations) 
     50                Open/R/Z refNum as userPathStr 
     51                if(V_flag != 0) 
     52                        //couldn't find the file, send user to web site to update 
     53                        sprintf str,"I could not determine what version of the SANS Macros you are running." 
     54                        str += " You need to go to the NCNR website for the latest version. Do you want to go there now?" 
     55                        DoAlert 1,str 
     56                        if(V_flag==1) 
     57                                BrowseURL "http://www.ncnr.nist.gov/programs/sans/data/red_anal.html" 
     58                        endif 
     59                        //don't need to close if nothing was opened (/Z) 
     60                         
     61                        return          //couldn't find either file, nothing opened, exit 
     62                endif 
     63        endif 
     64         
     65        // the file was opened, check the version 
     66        FReadLine refNum, installedStr 
     67        Close refnum 
     68         
     69        Print "Installed = ",installedStr        
     70         
     71        runningVersion = NumberByKey(StringFromList(0,"PACKAGE_VERSION"), installedStr,"=",";") 
     72        upToDateVersion = NumberByKey(StringFromList(0,"PACKAGE_VERSION"), currentStr,"=",";") 
     73         
     74        If(runningVersion != upToDateVersion) 
     75                sprintf str,"You are running version %g and the latest version is %g.",runningVersion,upToDateVersion 
    4676                str += " You need to go to the NCNR website for the latest version. Do you want to go there now?" 
    4777                DoAlert 1,str 
     
    4979                        BrowseURL "http://www.ncnr.nist.gov/programs/sans/data/red_anal.html" 
    5080                endif 
    51                 //don't need to close if nothing was opened (/Z) 
    5281        else 
    53          
    54                 FReadLine refNum, installedStr 
    55                 Close refnum 
    56                  
    57                 Print "Installed = ",installedStr        
    58                  
    59                 runningVersion = NumberByKey(StringFromList(0,"PACKAGE_VERSION"), installedStr,"=",";") 
    60                 upToDateVersion = NumberByKey(StringFromList(0,"PACKAGE_VERSION"), currentStr,"=",";") 
    61                  
    62                 If(runningVersion != upToDateVersion) 
    63                         sprintf str,"You are running version %g and the latest version is %g.",runningVersion,upToDateVersion 
    64                         str += " You need to go to the NCNR website for the latest version. Do you want to go there now?" 
    65                         DoAlert 1,str 
    66                         if(V_flag==1) 
    67                                 BrowseURL "http://www.ncnr.nist.gov/programs/sans/data/red_anal.html" 
    68                         endif 
    69                 else 
    70                         DoAlert 0,"You are running the most up-to-date version = "+StringByKey(StringFromList(0,"PACKAGE_VERSION"), currentStr,"=",";") 
    71                 endif 
     82                DoAlert 0,"You are running the most up-to-date version = "+StringByKey(StringFromList(0,"PACKAGE_VERSION"), currentStr,"=",";") 
    7283        endif 
    7384         
     85        return 
    7486End 
Note: See TracChangeset for help on using the changeset viewer.