Hy
I've build an Extension (with Multiplayer) for my game (Gta Vice City). But now I must find the Installdir of it also If it exist on the computer D:\Games\GTA VC and if it not exist C:\Games\Extension\GTA VC
How can I do this ?
Thank you
How can I found the install path of a Programm
7 posts
You can check with:
Your best bet is to look for a registry entry which contains the game's path by using ReadRegStr.
-Stu
However, this isn't a very good way to go about it. The user may have installed to Program Files ($PROGRAMFILES) or maybe even E:\IfFileExists "D:\Games\GTA VC\*.*" 0 +3
StrCpy $INSTDIR "D:\Games\GTA VC"
Goto done
IfFileExists "C:\Games\Extension\GTA VC\*.*" 0 +2
StrCpy $INSTDIR "C:\Games\Extension\GTA VC"
done:
Your best bet is to look for a registry entry which contains the game's path by using ReadRegStr.
-Stu
Thank you for answer me. Yes there is an RegStr is it right so ?
ReadRegStr $0 HKLM Software\Rockstar-Games\GTA Vice City "InstallPath"
StrCpy $0 $INSTDIR ""
done:
ReadRegStr $0 HKLM Software\Rockstar-Games\GTA Vice City "InstallPath"
StrCpy $0 $INSTDIR ""
done:
Or just do:
-Stu
ReadRegStr $INSTDIR HKLM Software\Rockstar-Games\GTA Vice City "InstallPath"
StrCmp $INSTDIR "" 0 +2
StrCpy $INSTDIR "C:\GTA VC"
Thank you for the reply.
But I've an other question:
The code:
Example: Function Path
And on the top I write call Path.
But there is an Error because I can't exec the Installer.
Thx Marc
But I've an other question:
The code:
must be in a Function ?
ReadRegStr $0 HKLM Software\Rockstar-Games\GTA Vice City "InstallPath"
StrCpy $0 $INSTDIR ""
done:
Example: Function Path
And on the top I write call Path.
But there is an Error because I can't exec the Installer.
Thx Marc
Even outside a function or section you easely could use
Thats all you need. If a valid registry string was found the new InstallDir is set otherwise it falls back to the previous value.InstallDir "C:\GTA Vice City"
InstallDirRegKey HKLM Software\Rockstar-Games\GTA Vice City "InstallPath"
Thank you that's it