Ignore:
Timestamp:
Jun 12, 2008 2:56:20 PM (15 years ago)
Author:
srkline
Message:

New install instructions, for manual install

New diagnostics in the installer that check to see if proper permissions exist, and suggest manual instll if not OK.

Wrapper now behaves better when new data files are loaded, selecting and "popping" the new file in the dataSet popup. also some better behvior if useCursors is checked.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/Packages/NCNR_Install.ipf

    r372 r384  
    2424                Abort "You've already run the installer. If you want to re-install, you'll need a fresh copy from the NCNR website." 
    2525        endif 
     26         
     27        // check for install problems 
     28        // locked folders, OS errors _err will be non-zero if there is an error 
     29        Variable UP_err,IH_err,IE_err 
     30        UP_err = FolderPermissionCheck("User Procedures:") 
     31        IH_err = FolderPermissionCheck("Igor Help Files:") 
     32        IE_err = FolderPermissionCheck("Igor Extensions:")       
     33//      Print UP_err,IH_err,IE_err 
     34 
     35        String alertStr="" 
     36        if(UP_err != 0) 
     37                alertStr += "User Procedures has no write permission.\r" 
     38        endif 
     39        if(IH_err != 0) 
     40                alertStr += "Igor Help Files has no write permission.\r" 
     41        endif 
     42        if(IE_err != 0) 
     43                alertStr += "Igor Extensions has no write permission.\r" 
     44        endif 
     45         
     46        if(UP_err != 0 || IH_err != 0 || IE_err != 0) 
     47                alertStr += "You will need to install manually." 
     48                DoAlert 0,alertStr 
     49                return(0) 
     50        endif 
     51         
    2652         
    2753        // check the platform 
     
    319345        endif 
    320346         
     347        // check for permissions 
     348        Variable UP_err,IH_err,IE_err 
     349        UP_err = FolderPermissionCheck("User Procedures:") 
     350        IH_err = FolderPermissionCheck("Igor Help Files:") 
     351        IE_err = FolderPermissionCheck("Igor Extensions:") 
     352         
     353        Print UP_err,IH_err,IE_err 
     354         
     355        String alertStr="" 
     356        if(UP_err != 0) 
     357                alertStr += "User Procedures has no write permission. Error = "+num2Str(UP_err)+"\r" 
     358        else 
     359                alertStr += "User Procedures permission is OK.\r" 
     360        endif 
     361        if(IH_err != 0) 
     362                alertStr += "Igor Help Files has no write permission. Error = "+num2Str(IH_err)+"\r" 
     363        else 
     364                alertStr += "Igor Help Files permission is OK.\r" 
     365        endif 
     366        if(IE_err != 0) 
     367                alertStr += "Igor Extensions has no write permission. Error = "+num2Str(IE_err)+"\r" 
     368        else 
     369                alertStr += "Igor Extensions permission is OK.\r" 
     370        endif 
     371         
     372        if(UP_err != 0 || IH_err != 0 || IE_err != 0) 
     373                alertStr += "You will need to install manually." 
     374        endif 
     375         
     376        Notebook $nb text="\r\r**Folder Permissions**\r" 
     377        Notebook $nb text=AlertStr +"\r" 
     378         
     379         
    321380        Notebook $nb text="\r\r**InstalledVersion.txt**\r" 
    322381        Notebook $nb text=textStr +"\r" 
     
    465524        return(0) 
    466525End 
     526 
     527//check each of the three folders 
     528// folder string MUST have the trailing colon 
     529Function FolderPermissionCheck(folderStr) 
     530        String folderStr 
     531        Variable refnum 
     532        String str="delete me" 
     533         
     534        String igorPathStr,resultStr="" 
     535        PathInfo Igor 
     536        igorPathStr = S_Path 
     537         
     538        NewPath /Q/O tmpPath, igorPathStr+folderStr 
     539 
     540         
     541        Open/Z/P=tmpPath refnum as "test.txt" 
     542        if(V_flag != 0) 
     543                return(V_flag) 
     544        else 
     545                FBinWrite refnum,str 
     546                Close refnum 
     547                 
     548//              Print "folder OK" 
     549                DeleteFile/Z/P=tmpPath  "test.txt" 
     550        endif 
     551         
     552         
     553        return(V_flag) 
     554end 
Note: See TracChangeset for help on using the changeset viewer.