mcmagure Posted October 1, 2013 Posted October 1, 2013 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
orbs Posted October 1, 2013 Posted October 1, 2013 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. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff
ffdshow Posted October 1, 2013 Posted October 1, 2013 (edited) $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 October 1, 2013 by ffdshow
mcmagure Posted October 1, 2013 Author Posted October 1, 2013 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
mcmagure Posted October 1, 2013 Author Posted October 1, 2013 $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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now