- Timestamp:
- Mar 19, 2010 11:55:53 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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()
Note: See TracChangeset
for help on using the changeset viewer.