Jump to content
Sign in to follow this  
mcmagure

Problems with RegRead

Recommended Posts

mcmagure

Hello community,

i just started with autoit and tried some examples from the helpfile.

I tried to read out the installation path of my flightsimulator but i got no results anyway. 

How do i use the regread command even when i don't know where the installation path exists?

for example:

some users install it under C: - others under d: - and further the install path could be named

in different ways.

I will find out where the install path is to use the result as an $var for further scripts.

could pls. give my someone a hint...

thx

 

Share this post


Link to post
Share on other sites
orbs

hello, and welcome to the AutoIt forum,

first, since you mentioned "flightsimulator" - do take care to verify that your intentions do not violate the forum rules, which has a strict opinion against game automation.

until a mod says otherwise, at least so far your issue seems legit to me. it's not hard to accomplish what you ask, but let's start with the basics: by saying "I tried to read out the installation path of my flightsimulator but i got no results anyway.", what exactly do you mean? what did you try, and what did you get? post your code, so we can guide you in the right direction.

Share this post


Link to post
Share on other sites
ffdshow

$InstallDir = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\flightsimulator", "InstallLocation")
If FileExists($InstallDir & "\flightsimulator.exe") Then
   Run($InstallDir & "\flightsimulator.exe")
EndIf

Or:

$InstallDir = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\flightsimulator", "InstallLocation")
If FileExists($InstallDir & "\flightsimulator.exe") Then
   MsgBox(0x40010, @ScriptName, "flightsimulator is already installed", 4)
   Exit
EndIf
Edited by ffdshow

Share this post


Link to post
Share on other sites
mcmagure

hello, and welcome to the AutoIt forum,

first, since you mentioned "flightsimulator" - do take care to verify that your intentions do not violate the forum rules, which has a strict opinion against game automation.

until a mod says otherwise, at least so far your issue seems legit to me. it's not hard to accomplish what you ask, but let's start with the basics: by saying "I tried to read out the installation path of my flightsimulator but i got no results anyway.", what exactly do you mean? what did you try, and what did you get? post your code, so we can guide you in the right direction.

 

Hi Orbs,

thx for this information. At least, i am anoid about installing my flightsimulator several times a year and spending hours by hours until finished.

So i wanna make myself an easy autoinstaller for unattended installation. i hope this will not violate the forum rules.

If it does pls give me the information. 

I found the fault value - i used "fsx.exe" instead of  "AppPath": that was the reason.

Local $var = RegRead("HKCU\Software\Microsoft\Microsoft Games\Flight Simulator\10.0\", "appPath")
MsgBox(4096, "Ordner für Programme:", $var)

I need the $var to give my script the path to install the sceneries into the right directory or using it as String

for an "ControlSetText" command for the installers.

thx 

Share this post


Link to post
Share on other sites
mcmagure
$InstallDir = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\flightsimulator", "InstallLocation")
If FileExists($InstallDir & "\flightsimulator.exe") Then
   Run($InstallDir & "\flightsimulator.exe")
EndIf

Or:

$InstallDir = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\flightsimulator", "InstallLocation")
If FileExists($InstallDir & "\flightsimulator.exe") Then
   MsgBox(0x40010, @ScriptName, "flightsimulator is already installed", 4)
   Exit
EndIf

Hi ffdshow,

thx for that example... i will try it ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×