diff --git a/tools/installer/PerformInstall.cpp b/tools/installer/PerformInstall.cpp index 1b2e54ef..0e07bd9b 100644 --- a/tools/installer/PerformInstall.cpp +++ b/tools/installer/PerformInstall.cpp @@ -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; } } diff --git a/tools/installer/Welcome.cpp b/tools/installer/Welcome.cpp index 741091fc..7f4337f8 100644 --- a/tools/installer/Welcome.cpp +++ b/tools/installer/Welcome.cpp @@ -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: diff --git a/tools/installer/installer.rc b/tools/installer/installer.rc index 51287cd1..3519b27f 100644 --- a/tools/installer/installer.rc +++ b/tools/installer/installer.rc @@ -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