Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
e44dd0f8
Commit
e44dd0f8
authored
Apr 21, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineboot: Automatically update the prefix directory if wine.inf changes.
parent
935313ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
33 deletions
+52
-33
server.c
dlls/ntdll/server.c
+1
-30
wineboot.c
programs/wineboot/wineboot.c
+51
-3
No files found.
dlls/ntdll/server.c
View file @
e44dd0f8
...
...
@@ -737,7 +737,6 @@ static void start_server(void)
static
void
setup_config_dir
(
void
)
{
const
char
*
p
,
*
config_dir
=
wine_get_config_dir
();
pid_t
pid
,
wret
;
if
(
chdir
(
config_dir
)
==
-
1
)
{
...
...
@@ -759,7 +758,7 @@ static void setup_config_dir(void)
mkdir
(
config_dir
,
0777
);
if
(
chdir
(
config_dir
)
==
-
1
)
fatal_perror
(
"chdir to %s
\n
"
,
config_dir
);
MESSAGE
(
"wine: creat
ing configuration directory '%s'...
\n
"
,
config_dir
);
MESSAGE
(
"wine: creat
ed the configuration directory '%s'
\n
"
,
config_dir
);
}
if
(
mkdir
(
"dosdevices"
,
0777
)
==
-
1
)
...
...
@@ -773,34 +772,6 @@ static void setup_config_dir(void)
mkdir
(
"drive_c"
,
0777
);
symlink
(
"../drive_c"
,
"dosdevices/c:"
);
symlink
(
"/"
,
"dosdevices/z:"
);
pid
=
fork
();
if
(
pid
==
-
1
)
fatal_perror
(
"fork"
);
if
(
!
pid
)
{
char
*
argv
[
3
];
static
char
argv0
[]
=
"tools/wineprefixcreate"
,
argv1
[]
=
"--quiet"
;
argv
[
0
]
=
argv0
;
argv
[
1
]
=
argv1
;
argv
[
2
]
=
NULL
;
wine_exec_wine_binary
(
argv
[
0
],
argv
,
NULL
);
fatal_perror
(
"could not exec wineprefixcreate"
);
}
else
{
int
status
;
while
((
wret
=
waitpid
(
pid
,
&
status
,
0
))
!=
pid
)
{
if
(
wret
==
-
1
&&
errno
!=
EINTR
)
fatal_perror
(
"wait4"
);
}
if
(
!
WIFEXITED
(
status
)
||
WEXITSTATUS
(
status
))
fatal_error
(
"wineprefixcreate failed while creating '%s'.
\n
"
,
config_dir
);
}
MESSAGE
(
"wine: '%s' created successfully.
\n
"
,
config_dir
);
}
...
...
programs/wineboot/wineboot.c
View file @
e44dd0f8
...
...
@@ -58,6 +58,7 @@
#define WIN32_LEAN_AND_MEAN
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_GETOPT_H
...
...
@@ -113,6 +114,49 @@ static char *get_wine_inf_path(void)
return
name
;
}
/* update the timestamp if different from the reference time */
static
BOOL
update_timestamp
(
const
char
*
config_dir
,
unsigned
long
timestamp
,
int
force
)
{
BOOL
ret
=
FALSE
;
int
fd
,
count
;
char
buffer
[
100
];
char
*
file
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
config_dir
)
+
sizeof
(
"/.update-timestamp"
)
);
if
(
!
file
)
return
FALSE
;
strcpy
(
file
,
config_dir
);
strcat
(
file
,
"/.update-timestamp"
);
if
((
fd
=
open
(
file
,
O_RDWR
))
!=
-
1
)
{
if
((
count
=
read
(
fd
,
buffer
,
sizeof
(
buffer
)
-
1
))
>=
0
)
{
buffer
[
count
]
=
0
;
if
(
!
strncmp
(
buffer
,
"disable"
,
sizeof
(
"disable"
)
-
1
))
goto
done
;
if
(
!
force
&&
timestamp
==
strtoul
(
buffer
,
NULL
,
10
))
goto
done
;
}
lseek
(
fd
,
0
,
SEEK_SET
);
ftruncate
(
fd
,
0
);
}
else
{
if
(
errno
!=
ENOENT
)
goto
done
;
if
((
fd
=
open
(
file
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
,
0666
))
==
-
1
)
goto
done
;
}
count
=
sprintf
(
buffer
,
"%lu
\n
"
,
timestamp
);
if
(
write
(
fd
,
buffer
,
count
)
!=
count
)
{
WINE_WARN
(
"failed to update timestamp in %s
\n
"
,
file
);
ftruncate
(
fd
,
0
);
}
else
ret
=
TRUE
;
done:
if
(
fd
!=
-
1
)
close
(
fd
);
HeapFree
(
GetProcessHeap
(),
0
,
file
);
return
ret
;
}
/* Performs the rename operations dictated in %SystemRoot%\Wininit.ini.
* Returns FALSE if there was an error, or otherwise if all is ok.
*/
...
...
@@ -617,7 +661,7 @@ static BOOL start_services_process(void)
}
/* execute rundll32 on the wine.inf file if necessary */
static
void
update_wineprefix
(
void
)
static
void
update_wineprefix
(
int
force
)
{
static
const
WCHAR
cmdlineW
[]
=
{
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
' '
,
'1'
,
'2'
,
'8'
,
' '
,
'\\'
,
'\\'
,
'?'
,
'\\'
,
'u'
,
'n'
,
'i'
,
'x'
};
...
...
@@ -632,8 +676,12 @@ static void update_wineprefix(void)
return
;
}
if
(
stat
(
inf_path
,
&
st
)
==
-
1
)
{
WINE_WARN
(
"cannot stat wine.inf file: %s
\n
"
,
strerror
(
errno
)
);
else
goto
done
;
}
if
(
update_timestamp
(
config_dir
,
st
.
st_mtime
,
force
))
{
WCHAR
*
buffer
;
DWORD
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
inf_path
,
-
1
,
NULL
,
0
);
...
...
@@ -823,7 +871,7 @@ int main( int argc, char *argv[] )
ProcessRunKeys
(
HKEY_LOCAL_MACHINE
,
runkeys_names
[
RUNKEY_RUNSERVICES
],
FALSE
,
FALSE
);
start_services_process
();
}
if
(
update
)
update_wineprefix
(
);
if
(
init
||
update
)
update_wineprefix
(
update
);
ProcessRunKeys
(
HKEY_LOCAL_MACHINE
,
runkeys_names
[
RUNKEY_RUNONCE
],
TRUE
,
TRUE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment