mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Core: GetIniKey fix
git-svn-id: svn://ultimatepp.org/upp/trunk@1724 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
f46e73d5aa
commit
bb4160c8cf
2 changed files with 15 additions and 13 deletions
|
|
@ -387,7 +387,7 @@ String GetIniKey(const char *id, const String& def) {
|
|||
static VectorMap<String, String> key;
|
||||
if(!s_ini_loaded) {
|
||||
s_ini_loaded = true;
|
||||
key = LoadIniFile(sIniFile ? sIniFile : ~ConfigFile("q.ini"));
|
||||
key = LoadIniFile(*sIniFile ? sIniFile : ~ConfigFile("q.ini"));
|
||||
#ifdef PLATFORM_WIN32
|
||||
if(key.GetCount() == 0)
|
||||
key = LoadIniFile("C:\\Q.INI");
|
||||
|
|
|
|||
|
|
@ -114,19 +114,21 @@ void SelfUpdate() {
|
|||
char dst[512];
|
||||
UpdateFile("UPDATER.EXE");
|
||||
::GetModuleFileName(NULL, dst, 512);
|
||||
String src = GetIniKey("UPDATE");
|
||||
if(src.IsEmpty()) return;
|
||||
src = AppendFileName(src, GetFileNamePos(dst));
|
||||
int dummy;
|
||||
if(NoUpdate(dst, src, dummy)) return;
|
||||
String commandline;
|
||||
const Vector<String>& cmd = CommandLine();
|
||||
for(int i = 0; i < cmd.GetCount(); i++) {
|
||||
commandline += ' ';
|
||||
commandline += FixArg(cmd[i]);
|
||||
{
|
||||
String src = GetIniKey("UPDATE");
|
||||
if(src.IsEmpty()) return;
|
||||
src = AppendFileName(src, GetFileNamePos(dst));
|
||||
int dummy;
|
||||
if(NoUpdate(dst, src, dummy)) return;
|
||||
String commandline;
|
||||
const Vector<String>& cmd = CommandLine();
|
||||
for(int i = 0; i < cmd.GetCount(); i++) {
|
||||
commandline += ' ';
|
||||
commandline += FixArg(cmd[i]);
|
||||
}
|
||||
if(WinExec(GetExeDirFile("updater.exe") + " " + GetFileName(dst) + commandline, SW_SHOWNORMAL) <= 31)
|
||||
return;
|
||||
}
|
||||
if(WinExec(GetExeDirFile("updater.exe") + " " + GetFileName(dst) + commandline, SW_SHOWNORMAL) <= 31)
|
||||
return;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue