installer now defaults to center of primary monitor

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401732
This commit is contained in:
David Anderson 2007-11-25 20:58:48 +00:00
parent 6545c3e08c
commit d5ddb0ce79
3 changed files with 27 additions and 3 deletions

View File

@ -143,6 +143,19 @@ bool CopyStructureRecursively(ICopyMethod *pCopyMethod,
/* Now copy folders */
while ((pSubList = pFileList->PeekCurrentFolder()) != NULL)
{
if (g_thread_args.m_bIsUpgrade)
{
/* :TODO: put this somewhere else because it technically
* means the progress bars get calculated wrong
*/
if (tstrcasecmp(pSubList->GetFolderName(), _T("cfg")) == 0
|| tstrcasecmp(pSubList->GetFolderName(), _T("configs")) == 0)
{
pFileList->PopCurrentFolder();
continue;
}
}
/* Try creating the folder */
if (!pCopyMethod->CreateFolder(pSubList->GetFolderName(), errbuf, maxchars))
{
@ -270,15 +283,17 @@ bool StartInstallProcess(HWND hWnd)
{
int val = MessageBox(
hWnd,
_T("It looks like a previous SourceMod installation exists. Do you want to upgrade? Select \"Yes\" to upgrade and keep configuration files. Select \"No\" to perform a full re-install."),
_T("It looks like a previous SourceMod installation exists. Select \"Yes\" to skip copying configuration files. Select \"No\" to perform a full re-install."),
_T("SourceMod Installer"),
MB_YESNO|MB_ICONQUESTION);
if (val == 0 || val == IDYES)
{
g_thread_args.m_bIsUpgrade = true;
}
else
{
g_thread_args.m_bIsUpgrade = false;
}
}

View File

@ -2,13 +2,22 @@
#include "Welcome.h"
#include "ChooseMethod.h"
bool g_bIsFirstRun = true;
INT_PTR CALLBACK WelcomeHandler(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
{
SetToGlobalPosition(hDlg);
if (!g_bIsFirstRun)
{
SetToGlobalPosition(hDlg);
}
else
{
g_bIsFirstRun = false;
}
return (INT_PTR)TRUE;
}
case WM_COMMAND:

View File

@ -68,7 +68,7 @@ END
//
IDD_WELCOME DIALOGEX 0, 0, 244, 74
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_CAPTION | WS_SYSMENU
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "SourceMod Installer"
FONT 8, "MS Shell Dlg", 400, 0, 0x1