jorgev Posted June 14, 2009 Share Posted June 14, 2009 Hello , I have the following code: $exepat = (IniRead ( "Rfini.ini", "Executable", "Path", "default")) Run (($exepat&" +fullproc") , "e:\games\rfactor") I also tried this: Run ($exepat&" +fullproc" , "e:\games\rfactor") I have this command executed when i push a button, the game start just fine, but ingame, once i want to start racing the game just crashes, If i start the game with the normal start menu shortcuts then it doesnt crash. this is the ini part: [Executable] Path=E:\Games\rFactor\rfactor.exe So the command just starts the game rfactor with the +fullproc parameter added to make sure the game uses my 2 cpu's. Removing the +fullproc parameter doesnt change something, game still crashes Im trying to find the reason why it crashes but cant think of something. The working dir path is what it should be. Anyone has got a suggestion? Link to comment Share on other sites More sharing options...
oMBRa Posted June 14, 2009 Share Posted June 14, 2009 does the game crashes when you run it manually without the "+fullproc" parameter? anyway try "fullproc" parameter without the leading plus Link to comment Share on other sites More sharing options...
Developers Jos Posted June 14, 2009 Developers Share Posted June 14, 2009 does the game crashes when you run it manually without the "+fullproc" parameter?anyway try "fullproc" parameter without the leading plusSo the command just starts the game rfactor with the +fullproc parameter added to make sure the game uses my 2 cpu's. Removing the +fullproc parameter doesnt change something, game still crashesIm trying to find the reason why it crashes but cant think of something. The working dir path is what it should be.Anyone has got a suggestion? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
KaFu Posted June 14, 2009 Share Posted June 14, 2009 Here's a discussion which might be linked to your problem, maybe the game needs to be started in some unusual manner (Env Vars etc)?http://www.autoitscript.com/forum/index.php?showtopic=96617 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
jorgev Posted June 14, 2009 Author Share Posted June 14, 2009 Hmm i've read true those posts but can't find a solution to this problem, Case $Button5 EnvSet("rfenv", "e:\games\rfactor") $runner = "e:\games\rfactor\rfactor.exe" Run ($runner, EnvGet("rfenv")) this starts the game also but it crashes on the same point, really strange actually, the game starts fine, but then ingame when i click something it crashes. With the normal shortcut the game runs fine Anyone has got another suggestion i could try? Link to comment Share on other sites More sharing options...
jorgev Posted June 15, 2009 Author Share Posted June 15, 2009 Now i checked with Process Explorer, the envirement isn't the problem i'm guessing. I did run the game rfactor with the normal shortcut, and also from within my autoitscript and the working dir is "e:\games\rfactor" in both cases. So what i'm thinking is that something else is the problem. I did run the game from the command line without any problem. I'm clueless. Link to comment Share on other sites More sharing options...
KaFu Posted June 15, 2009 Share Posted June 15, 2009 Have you set the workingdir in the Run() func corresponding to the one in the shortcut? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
jorgev Posted June 15, 2009 Author Share Posted June 15, 2009 Have you set the workingdir in the Run() func corresponding to the one in the shortcut?Yes i did, and when i checked in process explorer the working dir is correct,so there must be another reason why the application/game crashes when launched from the run commandsorry if i say this again, but its only once i'm ingame and click "load track" then the game crashes.i'm wondering what could be the reason knowing that the crash doesnt happen with the shortcut Link to comment Share on other sites More sharing options...
jorgev Posted June 15, 2009 Author Share Posted June 15, 2009 I now did another test i created a .bat file that would start the game rfactor.exe then in my autoitscript i executed the .bat file from the run command, and yes the game didnt crash anymore Maybe i can then set that cmd window that opens from the .bat on hidden, i could do that, but i don't think it's the proper way to do things. i would prefer if there was another way to start the game from within the script, not with an extra cmd window. Link to comment Share on other sites More sharing options...
KaFu Posted June 15, 2009 Share Posted June 15, 2009 Maybe take a look at shellexecute()? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
jorgev Posted June 16, 2009 Author Share Posted June 16, 2009 Actually i already did that. When i run the game from the shellexecute() command, the crash also happens. Link to comment Share on other sites More sharing options...
Inverted Posted June 16, 2009 Share Posted June 16, 2009 What happens if you copy your COMPILED script in the same folder as the game executable and run it there ? Link to comment Share on other sites More sharing options...
jorgev Posted June 16, 2009 Author Share Posted June 16, 2009 What happens if you copy your COMPILED script in the same folder as the game executable and run it there ?I tried that also, the game crashes. Link to comment Share on other sites More sharing options...
jorgev Posted June 16, 2009 Author Share Posted June 16, 2009 I have now found a solution to my problem. This is the command i'm using right now and the game doesnt crash: Run("cmd /c start " & $exepat, "e:\games\rfactor", @SW_HIDE) Can someone explain what exactly is happening here, what is the difference with running a program trough the cmd or directly from the run command. we wouldn't learn a thing if we don't know why the game would crash if launched in another way Link to comment Share on other sites More sharing options...
KaFu Posted June 16, 2009 Share Posted June 16, 2009 (edited) If I take a look at the helptext of 'start /?' then I see a parameter 'I' which you have to set to start the .exe with the same env-parameters as set in cmd.exe... so I just assume, that if you DON'T set that parameter, the .exe is started with the standard win-env parameters... I still think it has somehow to do with the parameters... Edited June 16, 2009 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
jorgev Posted June 16, 2009 Author Share Posted June 16, 2009 If I take a look at the helptext of 'start /?' then I see a parameter 'I' which you have to set to start the .exe with the same env-parameters as set in cmd.exe... so I just assume, that if you DON'T set that parameter, the .exe is started with the standard win-env parameters... I still think it has somehow to do with the parameters... Strange enough i did not set the I parameter for the start command, the working dir is set from the run command. INI Part: [Executable] Path=E:\Games\rFactor\rfactor.exe $exepat = (IniRead ( "Rfini.ini", "Executable", "Path", "default")) Run("cmd /c start " & $exepat&" +fullproc", "e:\games\rfactor", @SW_HIDE) I added the +fullproc parameter for dual core support, and it works. Link to comment Share on other sites More sharing options...
Inverted Posted June 16, 2009 Share Posted June 16, 2009 What happens IF you set the I parameter ? Let's get to the bottom of this ! Link to comment Share on other sites More sharing options...
KaFu Posted June 16, 2009 Share Posted June 16, 2009 What happens IF you set the I parameter ? Let's get to the bottom of this ! , that's what I thought afterwards and was to lazy to edit... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
jorgev Posted June 18, 2009 Author Share Posted June 18, 2009 What happens IF you set the I parameter ?Let's get to the bottom of this !Well, i did try this:Run("cmd /c start /I " & $exepat&" +fullproc", "e:\games\rfactor", @SW_HIDE)This way the game runs just fine, with the /I parameter set, but dont forget that:Run("cmd /c start " & $exepat&" +fullproc", "e:\games\rfactor", @SW_HIDE)also works fine.So basicly its about the difference betweenRun("e:\games\rfactor\rfactor.exe", "e:\games\rfactor")andRun("cmd /c start e:\games\rfactor\rfactor.exe", "e:\games\rfactor", @SW_HIDE) Link to comment Share on other sites More sharing options...
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