GenoPro Help Center
GenoPro Home  |  Help Center  |  Tutorials  |  Buy  |  Support  |  Site Map

Skip Navigation Links.

GenoPro Installation Command Line Parameters

The following describe the command line parameters to install GenoPro.  These command line parameters are available since GenoPro 2007.

Command Line Parameters

/Path Specifies the path to install GenoPro.  This command line parameter will fill the path in the setup dialog.
Example: InstallGenoPro.exe /Path "C:\My Genealogy\GenoPro"
/PathDefault Specifies the default suggested path to install GenoPro.  If GenoPro was previously installed, this value will be ignored since the installation program will use the previous path to perform the upgrade.  This is the suggested parameter to do a friendly upgrade.
Example: InstallGenoPro.exe /PathDefault "C:\My Genealogy\GenoPro"
/PathSaveAs Specifies the default folder to save the GenoPro (.gno) files.  When you save a new GenoPro document, GenoPro displays the Save As dialog for you to type the path and filename of your family tree.  The /PathSaveAs will pre-select the folder you wish your .gno files to be saved. If you do not specify /PathSaveAs, then GenoPro will pre-select the folder "My Documents".

The parameter value /PathSaveAs is written into two registry keys: HKEY_CURRENT_USER\Software\GenoPro.com\PathSaveAs and HKEY_USERS\.DEFAULT\Software\GenoPro.com\PathSaveAs, giving precedence to the registry key HKEY_CURRENT_USER\Software\GenoPro.com\PathSaveAs.  You may use the registry editor to manually edit those values.

GenoPro is capable to expend an environment variable.  For instance, if you enter the registry value "%USERPROFILE%\GenoPro" and GenoPro will expand to "C:\Users\Jim\GenoPro" (assuming the environment variable %USERPROFILE% equals to C:\Users\Jim).  Using environment variables is very useful for network installations, especially on a terminal server or Citrix environment.  To store the value %USERPROFILE% in the registry from a command line, you must escape the percent (%) with the hat (^), for example ^%USERPROFILE^%, otherwise the environment variable will be expanded before executing InstallGenoPro.exe

Examples:
InstallGenoPro.exe /PathSaveAs "C:\My GenoPro Files"
InstallGenoPro.exe /PathSaveAs \\ServerName\GenoProFiles
InstallGenoPro.exe /PathSaveAs ^%USERPROFILE^%\GenoPro
/U
(unattended)
Runs the installation unattended.  The installation will start without user intervention. If an error occurs (such as disk full, access denied, sharing violation), a message box will be displayed to the user, otherwise the installation will terminate automatically.
Example: InstallGenoPro.exe /PathDefault C:\GenoPro /U
/USilent Similar to /U, however the installation program will never display any error message to the user. This parameter implicitly assumes the installation will start and terminate without any user intervention.  This command option is for experienced system administrators since a script is necessary to display the status (success or failure) of the installation.  Please consult the table Installation Return Codes for details of each possible return code.
Example: InstallGenoPro.exe /USilent
/CU

Creates the shortcuts only for the Current User rather than creating the shortcuts for all users on the machine.  By default, GenoPro creates shortcuts in the Start menu and on the Desktop so every user can access GenoPro.
Example: InstallGenoPro.exe /CU

/ND

No Desktop shortcut.  Install GenoPro without creating a shortcut on the desktop.  This is good for unattended installations.
Example: InstallGenoPro.exe /ND /U

Installation Return Codes

After the installation terminates, the status code is always returned to the operating system indicating a success or a failure. If you are using a batch command line, the status code is stored in the variable ERRORLEVEL.  Here are the possible returned status codes:

ERROR_SUCCESS (0) The installation terminated successfully without any error.
ERROR_CANCELLED (1223) The operation was cancelled by the user. Typically the user never clicked on the "Install" button, or the user aborted the installation.  This status code is never returned if the installation was unattended.
ERROR_INVALID_NAME (123) The filename, directory name, or syntax is incorrect.
ERROR_ACCESS_DENIED (5) Access denied. There is not enough permission to write the file.
ERROR_SHARING_VIOLATION (32) The process cannot access the file because it is being used by another process. In other words, GenoPro may be already running.
ERROR_WRITE_FAULT (29) The system cannot write to the specified device.  This is either a disk full or some generic write error.

This is a sample generic batch file you can use for installation of GenoPro.  All error codes are handled in this sample file, so you can use it with any parameter

@Echo off
InstallGenoPro.exe /USilent /CU

if %ERRORLEVEL% == 0 goto Success
if %ERRORLEVEL% == 1223 goto Cancelled
if %ERRORLEVEL% == 5 goto AccessDenied
if %ERRORLEVEL% == 32 goto SharingViolation

Echo Error installing GenoPro.
goto Done

:Success
Echo Installation of GenoPro Successful.
goto Done

:Cancelled
Echo Installation of GenoPro cancelled by user.
goto Done

:AccessDenied
Echo Access Denied. You do not have permission to write files in the folder.
goto Done

:SharingViolation
Echo Sharing Violation. GenoPro is already running and cannot be upgraded.

:Done

The returned status code is a Win32 error code, so it can be used as a parameter to the API FormatMessage().  For instance, if you are using C/C++, you can use the following function to display the installation status to the user:

void
DisplayErrorMessageBox(DWORD dwErrorCode)  
  {
  LPTSTR paszErrorMessageFromSystem;

  FormatMessage(
    FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
    NULL,
    dwErrorCode,
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
    (LPTSTR)&paszErrorMessageFromSystem,
    0, NULL);

  TCHAR szErrorMessage[500]; // This should be dynamically allocated
  wsprintf(szErrorMessage,  
    "GenoPro installation failed with error code %d: %s",  
    dwErrorCode, paszErrorMessageFromSystem);  

  MessageBox(NULL, szErrorMessage, "GenoPro Installation Error", MB_OK);  
  LocalFree(paszErrorMessageFromSystem);
  }

 

Copyright © 1998-2014. All rights reserved. GenoPro® and the GenoPro logo are registered trademarks.