OpenRA / ra2

A Red Alert 2 mod for the OpenRA game engine
GNU General Public License v3.0
970 stars 160 forks source link

Unable to find mod.config, looking in wrong directory #732

Closed mikemike closed 4 years ago

mikemike commented 4 years ago

I'm on Win10, installed dependencies from https://github.com/OpenRA/OpenRA/blob/release-20200202/INSTALL.md.

I've placed ra2-master directory into C:/Program Files/OpenRa/mods/. In here I run make dependencies or make all and get met with the following error:

λ  ./make test                                                                                       
Exception calling "OpenText" with "1" argument(s): "Could not find file 'C:\Users\Mike\mod.config'." 
At C:\Program Files\OpenRA\mods\ra2-master\make.ps1:228 char:2                                       
+     $reader = [System.IO.File]::OpenText($fileName)                                                
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException                        
    + FullyQualifiedErrorId : FileNotFoundException                                                  

You cannot call a method on a null-valued expression.                                                
At C:\Program Files\OpenRA\mods\ra2-master\make.ps1:229 char:19                                      
+     while($null -ne ($line = $reader.ReadLine()))                                                  
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~                                                    
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException                             
    + FullyQualifiedErrorId : InvokeMethodOnNull                                                     

Required mod.config variables are missing:                                                           
   MOD_ID                                                                                            
   ENGINE_VERSION                                                                                    
   AUTOMATIC_ENGINE_MANAGEMENT                                                                       
   AUTOMATIC_ENGINE_SOURCE                                                                           
   AUTOMATIC_ENGINE_EXTRACT_DIRECTORY                                                                
   AUTOMATIC_ENGINE_TEMP_ARCHIVE_NAME                                                                
   ENGINE_DIRECTORY                                                                                  
Repair your mod.config (or user.config) and try again.                                               
Press enter to continue.                                                                             

It looks like make is looking in the user root, in this case C:/Users/Mike/. I might be able to get this working by editing make.ps1 or by extracting into the root of my user directory, but both solutions seem broken.

Am I missing something?

abcdefg30 commented 4 years ago

I still have to figure out what is causing this, but for some reason it always looks one directory up the tree on my end. You can work around this issue for now by using the old Command Line instead of Powershell (just type cmd inside the Powershell host).

abcdefg30 commented 4 years ago

I think I figured it out. Would you mind testing #734 to see if it fixes your problem?

mikemike commented 4 years ago

Amazing, thanks @abcdefg30 . Your patch on #734 works, as does using cmd instead of Powershell.

Output from #734 patch:

C:\Users\Mike\Downloads\ra2-make
λ  ./make all
OpenRA engine version release-20200202 is required.
Downloading engine...