1 | @ECHO OFF |
---|
2 | @echo ======================================================= |
---|
3 | @echo This file creates registry entries for GSAS and EXPGUI |
---|
4 | @echo = Run this from the directory where GSAS is installed = |
---|
5 | @echo ======================================================= |
---|
6 | |
---|
7 | REM Get this script's directory; make sure that the path ends |
---|
8 | REM with a single backslash |
---|
9 | set gsasloc=%~dp0\* |
---|
10 | set gsasloc=%gsasloc:\\*=\*% |
---|
11 | set gsasloc=%gsasloc:\*=\% |
---|
12 | |
---|
13 | REM test if representative files are found |
---|
14 | IF NOT EXIST %gsasloc%gsas.ico GOTO IconNotFound |
---|
15 | IF NOT EXIST %gsasloc%exe GOTO EXENotFound |
---|
16 | IF NOT EXIST %gsasloc%exe\ncnrpack.exe GOTO TclNotFound |
---|
17 | |
---|
18 | |
---|
19 | REM changed from HKLM to HKCU due to problems on Vista(?) |
---|
20 | @ECHO ON |
---|
21 | reg add HKCU\Software\Classes\.exp /ve /d EXPfile /f |
---|
22 | reg add HKCU\Software\Classes\EXPfile /v "GSAS experiment file" /d "GSAS Experiment File" /f |
---|
23 | reg add HKCU\Software\Classes\EXPfile\DefaultIcon /ve /d %gsasloc%gsas.ico,0 /f |
---|
24 | reg add HKCU\Software\Classes\EXPfile\Shell\EXPEDT\command /ve /d "%gsasloc%exe\expedt.exe %%1" /f |
---|
25 | reg add HKCU\Software\Classes\EXPfile\Shell\EXPGUI\command /ve /d "%gsasloc%exe\ncnrpack.exe %gsasloc%expgui\expgui ""%%1""" /f |
---|
26 | reg add HKCU\Software\Classes\EXPfile\Shell\GENLES\command /ve /d "%gsasloc%exe\genles.exe %%1" /f |
---|
27 | reg add HKCU\Software\Classes\EXPfile\Shell\PC-GSAS\command /ve /d "%gsasloc%exe\PC-GSAS.exe %%1" /f |
---|
28 | reg add HKCU\Software\Classes\EXPfile\Shell\POWPLOT\command /ve /d "%gsasloc%exe\powplot.exe %%1" /f |
---|
29 | reg add HKCU\Software\Classes\EXPfile\Shell\POWPREF\command /ve /d "%gsasloc%exe\powpref.exe %%1" /f |
---|
30 | |
---|
31 | REM The following command can be edited to select the default command when a .EXP file is double clicked |
---|
32 | REM Choices are EXPGUI, EXPEDT, GENLES, PS-GSAS, POWPREF or POWPLOT |
---|
33 | reg add HKCU\Software\Classes\EXPfile\Shell /ve /d EXPGUI /f |
---|
34 | |
---|
35 | pause |
---|
36 | exit |
---|
37 | |
---|
38 | :IconNotFound |
---|
39 | echo Error: File %gsasloc%gsas.ico was not found. Was this batch file run from a location other than the GSAS directory? |
---|
40 | pause |
---|
41 | exit |
---|
42 | |
---|
43 | :EXENotFound |
---|
44 | echo ERROR: Directory %gsasloc%exe was not found. Was this batch file run from a location other than the GSAS directory? |
---|
45 | pause |
---|
46 | exit |
---|
47 | |
---|
48 | :TclNotFound |
---|
49 | echo ERROR: File %gsasloc%exe\ncnrpack.exe was not found. Was this batch file run from a location other than the GSAS directory? |
---|
50 | pause |
---|
51 | exit |
---|
52 | |
---|