Changeset 644


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

Tweaks for the installer.

Location:
sans/Dev/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/ModelPicker/SANSModelPicker_v40.ipf

    r619 r644  
    479479// fails miserably if there are aliases in the UP folder, although 
    480480// the #include doesn't mind 
     481// 
     482// SRK -2010- I need to look in the special directory too (look there first) 
     483// 
    481484Function CheckFileInUPFolder(fileStr) 
    482485        String fileStr 
     
    490493        fileStr = RemoveExten(fileStr)+fileVerExt 
    491494         
     495        // the Igor 6.1 User Procedure Path, same sub-folders as in Igor App Folder 
     496        // the installer MOVES items here, so no troubles with aliases 
     497        String userPathStr=RemoveEnding(SpecialDirPath("Igor Pro User Files",0,0,0),":")+":" 
     498        String UPStr=userPathStr+"User Procedures:" 
     499        NewPath /O/Q/Z UPPath ,UPStr 
     500        ListAllFilesAndFolders("UPPath",1,1,0)  //this sets the global string allFiles 
     501        String list = allFiles 
     502        err = strsearch(list, fileStr, 0,2)             //this is not case-sensitive, but Igor 5! 
     503        if(err != -1) 
     504                return(1)               //name was found somewhere 
     505        endif 
     506         
     507        // name not found, try looking in the Igor Pro/ folder 
     508        // this will still fail if aliases are present here 
    492509        PathInfo Igor 
    493         String UPStr=S_path+"User Procedures:" 
     510        UPStr=S_path+"User Procedures:" 
    494511        NewPath /O/Q/Z UPPath ,UPStr 
    495         ListAllFilesAndFolders("UPPath",1,1,0)  //this sets allFiles 
    496         String list = allFiles 
     512        ListAllFilesAndFolders("UPPath",1,1,0)  //this sets the global string allFiles 
     513        list = allFiles 
    497514//      err = FindListItem(fileStr, list ,";" ,0) 
    498515        err = strsearch(list, fileStr, 0,2)             //this is not case-sensitive, but Igor 5! 
  • 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 
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Installer/NCNR_Install.ipf

    r631 r644  
    2424 
    2525// FEB 2010 - now make use of the user-specific procedure path. It's always writeable, and not in the application folder 
     26// 
     27// since old material may be installed, and permission may be gone: 
     28// - check for permission 
     29// - check for old material installed in Igor Pro/ 
     30// -- if nothing installed in Igor Pro/, then permissions are not a problem 
     31// -- install in the new uer-specific path as intended 
     32// 
    2633// -- now I need to search both locations to move old stuff out 
    2734// -- then install clean into the new user path (userPathStr) 
     
    6269                alertStr += "Igor Extensions has no write permission.\r" 
    6370        endif 
    64          
    65         if(forceInstall == 0) 
    66                 if(UP_err != 0 || IH_err != 0 || IE_err != 0) 
    67                         alertStr += "You will need to install manually." 
    68                         DoAlert 0,alertStr 
    69                         return(0) 
    70                 endif 
    71         endif 
     71 
     72/// SRK - 2010 - errors are not used here. instead, errors are caught if a file or folder move fails. If there 
     73// is nothing to move out, or it moves out OK, then permissions don't matter. 
     74         
     75//      if(forceInstall == 0) 
     76//              if(UP_err != 0 || IH_err != 0 || IE_err != 0) 
     77//                      alertStr += "You will need to install manually." 
     78//                      DoAlert 0,alertStr 
     79//                      return(0) 
     80//              endif 
     81//      endif 
    7282         
    7383         
     
    110120                if(isThere) 
    111121                        MoveFile/O/P=ExPath tmpStr as homePathStr+"NCNR_Moved_Files:"+tmpStr 
    112                         Print "Move file "+ tmpStr + " from Igor Extensions: "+num2str(V_flag) 
     122                        Print "Move file "+ tmpStr + " from Igor Extensions: "+IsMoveOK(V_flag) 
    113123                endif 
    114124        endfor 
     
    123133                if(isThere) 
    124134                        MoveFolder extPathStr+tmpStr as homePathStr+"NCNR_Moved_Files:NCNR_Moved_Folders:"+tmpStr 
    125                         Print "Move folder "+ tmpStr + " from Igor Extensions: "+num2str(V_flag) 
     135                        Print "Move folder "+ tmpStr + " from Igor Extensions: "+IsMoveOK(V_flag) 
    126136                endif 
    127137        endfor 
     
    138148                if(isThere) 
    139149                        MoveFile/O/P=ExPath tmpStr as homePathStr+"NCNR_Moved_Files:"+tmpStr 
    140                         Print "Move file "+ tmpStr + " from Igor Extensions: "+num2str(V_flag) 
     150                        Print "Move file "+ tmpStr + " from Igor Extensions: "+IsMoveOK(V_flag) 
    141151                endif 
    142152        endfor 
     
    149159                if(isThere) 
    150160                        MoveFolder extPathStr+tmpStr as homePathStr+"NCNR_Moved_Files:NCNR_Moved_Folders:"+tmpStr 
    151                         Print "Move folder "+ tmpStr + " from Igor Extensions: "+num2str(V_flag) 
     161                        Print "Move folder "+ tmpStr + " from Igor Extensions: "+IsMoveOK(V_flag) 
    152162                endif 
    153163        endfor 
     
    168178                if(isThere) 
    169179                        MoveFile/O/P=UPPath tmpStr as homePathStr+"NCNR_Moved_Files:"+tmpStr 
    170                         Print "Move file "+ tmpStr + " from User Procedures: "+num2str(V_flag) 
     180                        Print "Move file "+ tmpStr + " from User Procedures: "+IsMoveOK(V_flag) 
    171181                endif 
    172182        endfor 
     
    182192                // THIS is the problem, when NCNR_Help_Files is moved - it is in use 
    183193                        MoveFolder/Z UPPathStr + tmpStr as homePathStr+"NCNR_Moved_Files:NCNR_Moved_Folders:"+tmpStr 
    184                         Print "Move folder "+ tmpStr + " from User Procedures: "+num2str(V_flag) 
     194                        Print "Move folder "+ tmpStr + " from User Procedures: "+IsMoveOK(V_flag) 
    185195                endif 
    186196        endfor 
     
    198208                if(isThere) 
    199209                        MoveFile/O/P=UPPath tmpStr as homePathStr+"NCNR_Moved_Files:"+tmpStr 
    200                         Print "Move file "+ tmpStr + " from User Procedures: "+num2str(V_flag) 
     210                        Print "Move file "+ tmpStr + " from User Procedures: "+IsMoveOK(V_flag) 
    201211                endif 
    202212        endfor 
     
    211221                // THIS is the problem, when NCNR_Help_Files is moved - it is in use 
    212222                        MoveFolder/Z UPPathStr + tmpStr as homePathStr+"NCNR_Moved_Files:NCNR_Moved_Folders:"+tmpStr 
    213                         Print "Move folder "+ tmpStr + " from User Procedures: "+num2str(V_flag) 
     223                        Print "Move folder "+ tmpStr + " from User Procedures: "+IsMoveOK(V_flag) 
    214224                endif 
    215225        endfor 
     
    234244                if(isThere) 
    235245                        MoveFile/O/P=IHPath tmpStr as homePathStr+"NCNR_Moved_Files:"+tmpStr 
    236                         Print "Move file "+ tmpStr + " from Igor Help Files: "+num2str(V_flag) 
     246                        Print "Move file "+ tmpStr + " from Igor Help Files: "+IsMoveOK(V_flag) 
    237247                endif 
    238248        endfor   
     
    247257                if(isThere) 
    248258                        MoveFolder IHPathStr + tmpStr as homePathStr+"NCNR_Moved_Files:NCNR_Moved_Folders:"+tmpStr 
    249                         Print "Move folder "+ tmpStr + " from Igor Help Files: "+num2str(V_flag) 
     259                        Print "Move folder "+ tmpStr + " from Igor Help Files: "+IsMoveOK(V_flag) 
    250260                endif 
    251261        endfor 
     
    263273                if(isThere) 
    264274                        MoveFile/O/P=IHPath tmpStr as homePathStr+"NCNR_Moved_Files:"+tmpStr 
    265                         Print "Move file "+ tmpStr + " from Igor Help Files: "+num2str(V_flag) 
     275                        Print "Move file "+ tmpStr + " from Igor Help Files: "+IsMoveOK(V_flag) 
    266276                endif 
    267277        endfor   
     
    275285                if(isThere) 
    276286                        MoveFolder IHPathStr + tmpStr as homePathStr+"NCNR_Moved_Files:NCNR_Moved_Folders:"+tmpStr 
    277                         Print "Move folder "+ tmpStr + " from Igor Help Files: "+num2str(V_flag) 
     287                        Print "Move folder "+ tmpStr + " from Igor Help Files: "+IsMoveOK(V_flag) 
    278288                endif 
    279289        endfor 
     
    301311// the help files 
    302312        MoveFolder/Z=1 homePathStr+"NCNR_Help_Files" as IHPathStr+"NCNR_Help_Files" 
    303         Print "******Move folder NCNR_Help_Files into User Special Folder, NO overwite: "+num2str(V_flag) 
     313        Print "******Move folder NCNR_Help_Files into User Special Folder, NO overwite: "+IsMoveOK(V_flag) 
    304314 
    305315// not needed now 
    306316//      CreateAliasShortcut/O/P=SpecialPath "NCNR_Help_Files" as igorPathStr+"Igor Help Files:NCNR_Help_Files" 
    307 //      Print "Creating shortcut from NCNR_Help_Files into Igor Help Files: "+num2str(V_flag) 
     317//      Print "Creating shortcut from NCNR_Help_Files into Igor Help Files: "+IsMoveOK(V_flag) 
    308318         
    309319 
    310320// the User Procedures   
    311321        MoveFolder/Z=1 homePathStr+"NCNR_User_Procedures" as UPPathStr+"NCNR_User_Procedures" 
    312         Print "*******Move folder NCNR_User_Procedures into User Procedures, NO overwrite: "+num2str(V_flag) 
     322        Print "*******Move folder NCNR_User_Procedures into User Special Folder, NO overwrite: "+IsMoveOK(V_flag) 
    313323         
    314324// don't need an alias for the UserProcedures - they're already here.... 
    315325 
    316326 
    317 // Igor Extensions 
    318         MoveFolder/Z=1 homePathStr+"NCNR_Extensions" as UPPathStr+"NCNR_Extensions" 
    319         Print "*******Move folder NCNR_Extensions into User Procedures, NO overwrite: "+num2str(V_flag) 
     327// Igor Extensions, platform-specific 
     328        if(isMac) 
     329                MoveFolder/Z=1 homePathStr+"NCNR_Extensions:Mac_XOP" as extPathStr+"NCNR_Extensions" 
     330        else 
     331                MoveFolder/Z=1 homePathStr+"NCNR_Extensions:Win_XOP" as extPathStr+"NCNR_Extensions" 
     332        endif 
     333        Print "*******Move folder NCNR_Extensions:xxx_XOP into User Special Folder, NO overwrite: "+IsMoveOK(V_flag) 
    320334//       
    321335// not needed now 
     
    325339//              CreateAliasShortcut/O/P=UPPath "NCNR_Extensions:Win_XOP" as igorPathStr+"Igor Extensions:NCNR_Extensions" 
    326340//      endif 
    327 //      Print "Creating shortcut for XOP into Igor Extensions: "+num2str(V_flag) 
     341//      Print "Creating shortcut for XOP into Igor Extensions: "+IsMoveOK(V_flag) 
    328342         
    329343 
     
    339353//                      MoveFolder/O/P=IHPath tmpStr as homePathStr+"NCNR_Moved_Files:"+tmpStr 
    340354                        CreateAliasShortcut/O/P=UtilPath tmpStr as homePathStr +tmpStr 
    341                         Print "Creating shortcut for "+tmpStr+" into top level: "+num2str(V_flag) 
     355                        Print "Creating shortcut for "+tmpStr+" into top level: "+IsMoveOK(V_flag) 
    342356//              endif 
    343357        endfor 
     
    670684end 
    671685 
     686Function/S IsMoveOK(flag) 
     687        Variable flag 
     688         
     689        String alertStr="There are old NCNR procedures and files present. You will need admin privileges to manually remove them before you can continue" 
     690        if(flag == 0) 
     691                return(" OK") 
     692        else 
     693                DoAlert 0,alertStr 
     694                return(" ERROR") 
     695        endif 
     696end 
     697 
    672698// this will "force" an install, even if there are R/W errors 
    673699Macro ForceInstall() 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf

    r577 r644  
    11441144//between calibrated wavelengths for a given attenuator 
    11451145// 
    1146 // 
     1146// Mar 2010 - abs() added to attStr to account for ICE reporting -0.0001 as an attenuator position, which truncates to "-0" 
    11471147Function LookupAttenNG3(lambda,attenNo) 
    11481148        Variable lambda, attenNo 
    11491149         
    11501150        Variable trans 
    1151         String attStr="root:myGlobals:Attenuators:ng3att"+num2str(trunc(attenNo)) 
     1151        String attStr="root:myGlobals:Attenuators:ng3att"+num2str(trunc(abs(attenNo))) 
    11521152        String lamStr = "root:myGlobals:Attenuators:ng3lambda" 
    11531153         
     
    11881188// local function 
    11891189// 
     1190// Mar 2010 - abs() added to attStr to account for ICE reporting -0.0001 as an attenuator position, which truncates to "-0" 
    11901191Function LookupAttenNG7(lambda,attenNo) 
    11911192        Variable lambda, attenNo 
    11921193         
    11931194        Variable trans 
    1194         String attStr="root:myGlobals:Attenuators:ng7att"+num2str(trunc(attenNo)) 
     1195        String attStr="root:myGlobals:Attenuators:ng7att"+num2str(trunc(abs(attenNo))) 
    11951196        String lamStr = "root:myGlobals:Attenuators:ng7lambda" 
    11961197         
Note: See TracChangeset for help on using the changeset viewer.