- Timestamp:
- Mar 19, 2010 11:55:53 AM (13 years ago)
- 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 479 479 // fails miserably if there are aliases in the UP folder, although 480 480 // the #include doesn't mind 481 // 482 // SRK -2010- I need to look in the special directory too (look there first) 483 // 481 484 Function CheckFileInUPFolder(fileStr) 482 485 String fileStr … … 490 493 fileStr = RemoveExten(fileStr)+fileVerExt 491 494 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 492 509 PathInfo Igor 493 StringUPStr=S_path+"User Procedures:"510 UPStr=S_path+"User Procedures:" 494 511 NewPath /O/Q/Z UPPath ,UPStr 495 ListAllFilesAndFolders("UPPath",1,1,0) //this sets allFiles496 Stringlist = allFiles512 ListAllFilesAndFolders("UPPath",1,1,0) //this sets the global string allFiles 513 list = allFiles 497 514 // err = FindListItem(fileStr, list ,";" ,0) 498 515 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 2 2 #pragma IgorVersion=6.1 3 3 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 5 6 // 6 7 // compares to the installed version string, which is installed in UP:NCNR_UP … … 40 41 fileNameStr = IgorPathStr + "User Procedures:NCNR_User_Procedures:InstalledVersion.txt" 41 42 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) 42 47 Open/R/Z refNum as fileNameStr 43 48 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 46 76 str += " You need to go to the NCNR website for the latest version. Do you want to go there now?" 47 77 DoAlert 1,str … … 49 79 BrowseURL "http://www.ncnr.nist.gov/programs/sans/data/red_anal.html" 50 80 endif 51 //don't need to close if nothing was opened (/Z)52 81 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,"=",";") 72 83 endif 73 84 85 return 74 86 End -
sans/Dev/trunk/NCNR_User_Procedures/Common/Installer/NCNR_Install.ipf
r631 r644 24 24 25 25 // 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 // 26 33 // -- now I need to search both locations to move old stuff out 27 34 // -- then install clean into the new user path (userPathStr) … … 62 69 alertStr += "Igor Extensions has no write permission.\r" 63 70 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 72 82 73 83 … … 110 120 if(isThere) 111 121 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) 113 123 endif 114 124 endfor … … 123 133 if(isThere) 124 134 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) 126 136 endif 127 137 endfor … … 138 148 if(isThere) 139 149 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) 141 151 endif 142 152 endfor … … 149 159 if(isThere) 150 160 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) 152 162 endif 153 163 endfor … … 168 178 if(isThere) 169 179 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) 171 181 endif 172 182 endfor … … 182 192 // THIS is the problem, when NCNR_Help_Files is moved - it is in use 183 193 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) 185 195 endif 186 196 endfor … … 198 208 if(isThere) 199 209 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) 201 211 endif 202 212 endfor … … 211 221 // THIS is the problem, when NCNR_Help_Files is moved - it is in use 212 222 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) 214 224 endif 215 225 endfor … … 234 244 if(isThere) 235 245 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) 237 247 endif 238 248 endfor … … 247 257 if(isThere) 248 258 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) 250 260 endif 251 261 endfor … … 263 273 if(isThere) 264 274 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) 266 276 endif 267 277 endfor … … 275 285 if(isThere) 276 286 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) 278 288 endif 279 289 endfor … … 301 311 // the help files 302 312 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) 304 314 305 315 // not needed now 306 316 // 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) 308 318 309 319 310 320 // the User Procedures 311 321 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) 313 323 314 324 // don't need an alias for the UserProcedures - they're already here.... 315 325 316 326 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) 320 334 // 321 335 // not needed now … … 325 339 // CreateAliasShortcut/O/P=UPPath "NCNR_Extensions:Win_XOP" as igorPathStr+"Igor Extensions:NCNR_Extensions" 326 340 // 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) 328 342 329 343 … … 339 353 // MoveFolder/O/P=IHPath tmpStr as homePathStr+"NCNR_Moved_Files:"+tmpStr 340 354 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) 342 356 // endif 343 357 endfor … … 670 684 end 671 685 686 Function/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 696 end 697 672 698 // this will "force" an install, even if there are R/W errors 673 699 Macro ForceInstall() -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf
r577 r644 1144 1144 //between calibrated wavelengths for a given attenuator 1145 1145 // 1146 // 1146 // Mar 2010 - abs() added to attStr to account for ICE reporting -0.0001 as an attenuator position, which truncates to "-0" 1147 1147 Function LookupAttenNG3(lambda,attenNo) 1148 1148 Variable lambda, attenNo 1149 1149 1150 1150 Variable trans 1151 String attStr="root:myGlobals:Attenuators:ng3att"+num2str(trunc(a ttenNo))1151 String attStr="root:myGlobals:Attenuators:ng3att"+num2str(trunc(abs(attenNo))) 1152 1152 String lamStr = "root:myGlobals:Attenuators:ng3lambda" 1153 1153 … … 1188 1188 // local function 1189 1189 // 1190 // Mar 2010 - abs() added to attStr to account for ICE reporting -0.0001 as an attenuator position, which truncates to "-0" 1190 1191 Function LookupAttenNG7(lambda,attenNo) 1191 1192 Variable lambda, attenNo 1192 1193 1193 1194 Variable trans 1194 String attStr="root:myGlobals:Attenuators:ng7att"+num2str(trunc(a ttenNo))1195 String attStr="root:myGlobals:Attenuators:ng7att"+num2str(trunc(abs(attenNo))) 1195 1196 String lamStr = "root:myGlobals:Attenuators:ng7lambda" 1196 1197
Note: See TracChangeset
for help on using the changeset viewer.