FINDTHISGAMS

Table of Contents

Introduction

The Windows command line tool findthisgams is used for modifying GAMS specific registry entries created by the GAMS installer. These registry entries are primarily used for Windows file associations for GAMS related files (*.gms, *.gdx, *.gpr) and for the Object-oriented GAMS APIs which use the registry key gams.location. for finding a valid GAMS system directory. This documentation uses the following registry hive abbreviations:

  • HKCU: HKEY_CURRENT_USER
  • HKLM: HKEY_LOCAL_MACHINE
  • HKCR: HKEY_CLASSES_ROOT
Attention
This tool should be used with caution and only when necessary, as it changes the state of the registry. Reading this documentation carefully before use is advised.

Usage

findthisgams.exe [-q] [ list | delete (HKLM|HKCU) | write (HKLM|HKCU) ] [ide]

Without arguments: When findthisgams.exe is run without arguments, the tool tries to register the current GAMS system directory by either writing to HKCU (which takes precedence over HKLM) or by deleting entries in HKCU that hide the correct entries (current system directory) in HKLM.

-q: Run quietly. No pop-ups.

list: Print a summary of GAMS related registry entries (old and new).

delete (HKLM|HKCU): Deletes the registry entries in either HKLM or HKCU. The tool tries to delete both the old and the new style registry entries.

write (HKLM|HKCU): Writes the registry entries for the current GAMS system directory either to HKLM or HKCU.

ide: Per default, when findthisgams.exe writes to the registry, it uses GAMS Studio for file associations. Specifying ide will register the GAMS IDE instead.

Registry Keys

The registry entries created by the Windows installer have changed with GAMS 32. When running findthisgams with command line parameter list, the registy is queried for both the old and the new style registry keys. This gives a good overview of the current state of the registry before initiating any actual modifications to the registry:

Old registry keys (up to GAMS 31):

[HKCR|HKCU]\.gms
[HKCR|HKCU]\.gdx
[HKCR|HKCU]\gamside.file
[HKCR|HKCU]\gamside.file\shell\open\command
[HKCR|HKCU]\.gpr
[HKCR|HKCU]\gamside.project
[HKCR|HKCU]\gamside.project\shell\open\command
[HKCR|HKCU]\gams.location

New registry keys (GAMS 32 and later):

[HKLM|HKCU]\Software\Classes\.gms  
[HKLM|HKCU]\Software\Classes\.gdx  
[HKLM|HKCU]\Software\Classes\gamside.file  
[HKLM|HKCU]\Software\Classes\gamside.file\DefaultIcon  
[HKLM|HKCU]\Software\Classes\gamside.file\shell\open\command  
[HKLM|HKCU]\Software\Classes\.gpr  
[HKLM|HKCU]\Software\Classes\gamside.project  
[HKLM|HKCU]\Software\Classes\gamside.project\DefaultIcon  
[HKLM|HKCU]\Software\Classes\gamside.project\shell\open\command  
[HKLM|HKCU]\Software\Classes\gams.location  
Note
In order to access registry entries in HKLM, findthisgams needs to be run with administrative privileges.