2.1.10.17 GetAppPath


Description

Get Origin program path or the user file folder path.

Syntax

string GetAppPath( BOOL bServerPath = FALSE )

Parameters

bServerPath
[input] TRUE to get the Origin's program path, and FALSE to get the User Files path.

Return

A string containing the requested path.

Examples

EX1

// This is a self contained sample program for the function GetAppPath, 
// To run the program, enter the following command in the Script window:
//   GetAppPath_ex1
// When you run this program in the normal Origin environment, 
// the following meassage will be printed:
//   OK: System header(wksheet.h) IS in the Program path.
//   OK: System header(wksheet.h) is NOT in the User Files path.
//
void    GetAppPath_ex1()
{        
    string strOFile = GetAppPath(TRUE) + "originc\\system\\wksheet.h";  // in Origin's program path
    string strUFile = GetAppPath(FALSE) + "originc\\system\\wksheet.h"; // in User Files path
    
    if(strOFile.IsFile())
    {
        printf("  OK: System header(wksheet.h) IS in the Program path.\n");
    }
    else {
        printf("  NO: System header(wksheet.h) is NOT in the Program path. It should!\n");
    }
    
    if(strUFile.IsFile())
    {
        printf("  NO: System header(wksheet.h) IS in the User Files path. It shouldn't!\n");
    }
    else {
        printf("  OK: System header(wksheet.h) is NOT in the User Files path.\n");
    }
}

Remark

Get Origin's software path including the last '\\' character.

Origin's program path is typically where Origin's EXE and DLL files are located. In a network version, this is typically a remove path on a server computer where the server version of Origin is installed. In a single user installation, this is always the location where Origin's EXE and DLL files are installed. Origin C system files are always installed inside the program path.

Origin's User Files path is typically assigned by the user when running Origin for the first time. It is either in the operating system's Application Data path (e.g., C:\Documents and Settings\myLogInName\Application Data\OriginLab\) or a Custom Folder (e.g., D:\myOriginFolder\myLoginName\). This is where all the files related to a particular customization of Origin are located. You will find origin.ini and other templates and CNF files in this location.

See Also

Header to Include

origin.h

Reference