2012-06-08 12:53:33 +00:00
|
|
|
/*
|
|
|
|
Copyright (C) 2012 Birunthan Mohanathas
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SKININSTALLER_DIALOGINSTALL_H_
|
|
|
|
#define SKININSTALLER_DIALOGINSTALL_H_
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "unzip.h"
|
|
|
|
#include "../Library/Dialog.h"
|
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
class DialogInstall : public Dialog
|
2012-06-08 12:53:33 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void Create(HINSTANCE hInstance, LPWSTR lpCmdLine);
|
|
|
|
|
|
|
|
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
INT_PTR OnInitDialog(WPARAM wParam, LPARAM lParam);
|
|
|
|
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
|
2012-06-10 09:01:17 +00:00
|
|
|
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
|
2012-06-08 12:53:33 +00:00
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
static DialogInstall* c_Dialog;
|
2012-06-08 12:53:33 +00:00
|
|
|
|
|
|
|
protected:
|
2013-05-31 14:18:52 +00:00
|
|
|
virtual Tab& GetActiveTab();
|
2012-06-08 12:53:33 +00:00
|
|
|
|
|
|
|
private:
|
2013-05-31 14:18:52 +00:00
|
|
|
friend class DialogPackage;
|
2012-06-10 07:48:07 +00:00
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
class TabInstall : public Tab
|
2012-06-08 12:53:33 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-05-31 14:18:52 +00:00
|
|
|
TabInstall(HWND window);
|
2012-06-08 12:53:33 +00:00
|
|
|
|
|
|
|
virtual void Initialize();
|
|
|
|
|
|
|
|
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Timer
|
|
|
|
{
|
|
|
|
Thread = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
enum PackageFormat
|
|
|
|
{
|
|
|
|
None,
|
|
|
|
New,
|
|
|
|
Old
|
|
|
|
};
|
|
|
|
|
|
|
|
enum PackageFlag
|
|
|
|
{
|
|
|
|
Backup = 0x0001
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PackageFooter
|
|
|
|
{
|
|
|
|
__int64 size;
|
|
|
|
BYTE flags;
|
|
|
|
char key[7];
|
|
|
|
};
|
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
DialogInstall(HWND wnd, const WCHAR* file);
|
|
|
|
virtual ~DialogInstall();
|
2012-06-08 12:53:33 +00:00
|
|
|
|
|
|
|
bool ReadPackage();
|
|
|
|
bool ReadOptions(const WCHAR* file);
|
|
|
|
bool InstallPackage();
|
|
|
|
void BeginInstall();
|
2012-06-10 15:11:55 +00:00
|
|
|
static UINT __stdcall InstallThread(void* pParam);
|
2012-06-08 12:53:33 +00:00
|
|
|
bool ExtractCurrentFile(const std::wstring& fileName);
|
|
|
|
|
|
|
|
void LaunchRainmeter();
|
|
|
|
void KeepVariables();
|
2012-06-10 09:01:17 +00:00
|
|
|
|
2013-10-06 14:25:03 +00:00
|
|
|
static void CleanLayoutFile(const WCHAR* file);
|
|
|
|
|
2012-06-08 14:24:28 +00:00
|
|
|
static bool IsIgnoredSkin(const WCHAR* name);
|
2012-10-02 14:44:47 +00:00
|
|
|
static bool IsIgnoredLayout(const WCHAR* name);
|
2012-06-08 14:24:28 +00:00
|
|
|
static bool IsIgnoredAddon(const WCHAR* name);
|
|
|
|
static bool IsIgnoredPlugin(const WCHAR* name);
|
2012-06-08 12:53:33 +00:00
|
|
|
|
|
|
|
static int CompareVersions(const std::wstring& strA, const std::wstring& strB);
|
|
|
|
static std::vector<std::wstring> Tokenize(const std::wstring& str, const std::wstring& delimiters);
|
|
|
|
static bool CreateDirectoryRecursive(const std::wstring& path);
|
|
|
|
static std::wstring GetFileVersionString(const WCHAR* fileName);
|
|
|
|
static std::wstring GetDotNetVersionString();
|
|
|
|
static std::wstring GetWindowsVersionString();
|
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
TabInstall m_TabInstall;
|
2012-06-08 12:53:33 +00:00
|
|
|
|
2012-06-24 13:43:51 +00:00
|
|
|
HBITMAP m_HeaderBitmap;
|
|
|
|
|
2012-06-08 12:53:33 +00:00
|
|
|
HANDLE m_InstallThread;
|
|
|
|
|
|
|
|
std::wstring m_ErrorMessage;
|
|
|
|
|
|
|
|
unzFile m_PackageUnzFile;
|
|
|
|
std::wstring m_PackageFileName;
|
|
|
|
std::wstring m_PackageRoot;
|
|
|
|
PackageFormat m_PackageFormat;
|
|
|
|
std::set<std::wstring> m_PackageSkins;
|
2012-10-02 14:44:47 +00:00
|
|
|
std::set<std::wstring> m_PackageLayouts;
|
2012-06-08 12:53:33 +00:00
|
|
|
std::set<std::wstring> m_PackageAddons;
|
|
|
|
std::set<std::wstring> m_PackageFonts;
|
|
|
|
std::set<std::wstring> m_PackagePlugins;
|
|
|
|
|
2012-06-12 12:27:40 +00:00
|
|
|
bool m_BackupPackage;
|
2012-06-10 09:01:17 +00:00
|
|
|
bool m_BackupSkins;
|
2012-06-08 12:53:33 +00:00
|
|
|
bool m_MergeSkins;
|
2012-06-10 09:01:17 +00:00
|
|
|
bool m_SystemFonts;
|
2012-06-08 12:53:33 +00:00
|
|
|
std::vector<std::wstring> m_VariablesFiles;
|
|
|
|
std::vector<std::wstring> m_LoadSkins;
|
2012-10-02 14:44:47 +00:00
|
|
|
std::wstring m_LoadLayout;
|
2012-06-08 12:53:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|