File tree Expand file tree Collapse file tree 4 files changed +49
-2
lines changed Expand file tree Collapse file tree 4 files changed +49
-2
lines changed Original file line number Diff line number Diff line change @@ -207,4 +207,12 @@ pub trait Runner {
207
207
let executable_path = self . info ( ) . executable_path ( ) ;
208
208
executable_path. exists ( ) && executable_path. is_file ( )
209
209
}
210
+
211
+ /// Initialize a prefix at the specified path using the runner's executable.
212
+ ///
213
+ /// # Arguments
214
+ ///
215
+ /// * `prefix` - Path where the new prefix should be created. The directory will be
216
+ /// created if it doesn't exist.
217
+ fn initialize ( & self , prefix : impl AsRef < Path > ) -> Result < ( ) , Error > ;
210
218
}
Original file line number Diff line number Diff line change 1
1
use super :: { Runner , RunnerInfo , Wine } ;
2
- use std:: path:: { Path , PathBuf } ;
2
+ use std:: {
3
+ path:: { Path , PathBuf } ,
4
+ process:: Command ,
5
+ } ;
3
6
4
7
/// Proton runner implementation
5
8
///
@@ -41,4 +44,16 @@ impl Runner for Proton {
41
44
fn info_mut ( & mut self ) -> & mut RunnerInfo {
42
45
& mut self . info
43
46
}
47
+
48
+ fn initialize ( & self , prefix : impl AsRef < Path > ) -> Result < ( ) , crate :: Error > {
49
+ Command :: new ( self . info ( ) . executable_path ( ) )
50
+ . arg ( "run" )
51
+ . arg ( "wineboot" )
52
+ . env ( "WINEPREFIX" , prefix. as_ref ( ) )
53
+ . env ( "STEAM_COMPAT_DATA_PATH" , prefix. as_ref ( ) )
54
+ . env ( "STEAM_COMPAT_CLIENT_INSTALL_PATH" , "" )
55
+ . output ( ) ?;
56
+
57
+ Ok ( ( ) )
58
+ }
44
59
}
Original file line number Diff line number Diff line change 1
1
use super :: { Proton , Runner , RunnerInfo , Wine } ;
2
- use std:: path:: { Path , PathBuf } ;
2
+ use std:: {
3
+ path:: { Path , PathBuf } ,
4
+ process:: Command ,
5
+ } ;
3
6
4
7
/// UMU (Unified Launcher) runner implementation
5
8
///
@@ -48,4 +51,14 @@ impl Runner for UMU {
48
51
fn info_mut ( & mut self ) -> & mut RunnerInfo {
49
52
& mut self . info
50
53
}
54
+
55
+ fn initialize ( & self , prefix : impl AsRef < Path > ) -> Result < ( ) , crate :: Error > {
56
+ let proton_path = self . proton . as_ref ( ) . unwrap ( ) . info ( ) . directory ( ) ;
57
+ Command :: new ( self . info ( ) . executable_path ( ) )
58
+ . arg ( "wineboot" ) // This is wrong but it'll anyways initialize the prefix
59
+ . env ( "WINEPREFIX" , prefix. as_ref ( ) )
60
+ . env ( "PROTONPATH" , proton_path)
61
+ . output ( ) ?;
62
+ Ok ( ( ) )
63
+ }
51
64
}
Original file line number Diff line number Diff line change 1
1
use super :: { Runner , RunnerInfo } ;
2
2
use std:: path:: { Path , PathBuf } ;
3
+ use std:: process:: Command ;
3
4
4
5
/// Wine runner implementation
5
6
///
@@ -58,4 +59,14 @@ impl Runner for Wine {
58
59
fn info_mut ( & mut self ) -> & mut RunnerInfo {
59
60
& mut self . info
60
61
}
62
+
63
+ fn initialize ( & self , prefix : impl AsRef < Path > ) -> Result < ( ) , crate :: Error > {
64
+ Command :: new ( self . info ( ) . executable_path ( ) )
65
+ . arg ( "wineboot" )
66
+ . arg ( "--init" )
67
+ . env ( "WINEPREFIX" , prefix. as_ref ( ) )
68
+ . output ( ) ?;
69
+
70
+ Ok ( ( ) )
71
+ }
61
72
}
You can’t perform that action at this time.
0 commit comments