Rewrote SkinInstaller .rmskin install code.

Added support for new .rmskin format.
This commit is contained in:
Birunthan Mohanathas 2012-06-08 15:53:33 +03:00
parent 74ffb0a9d1
commit 65b2b32c28
13 changed files with 1451 additions and 2065 deletions

View File

@ -18,11 +18,11 @@
#include "StdAfx.h"
#include "DialogBackup.h"
#include "DialogInstall.h"
#include "resource.h"
#include "Application.h"
#include "Rainstaller.h"
GLOBALDATA g_Data;
GlobalData g_Data;
/*
** Entry point
@ -30,16 +30,23 @@ GLOBALDATA g_Data;
*/
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
{
bool loadTheme = (_wcsnicmp(lpCmdLine, L"/LoadTheme ", 11) == 0);
if (wcscmp(lpCmdLine, L"/BACKUP") != 0 && !loadTheme)
{
// Temporary solution until Rainstaller rewrite
return Rainstaller(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
}
// Avoid loading a dll from current directory
SetDllDirectory(L"");
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
InitCommonControls();
if (lpCmdLine[0] == L'"')
{
// Strip quotes
++lpCmdLine;
WCHAR* pos = wcsrchr(lpCmdLine, L'"');
if (pos)
{
*pos = L'\0';
}
}
WCHAR buffer[MAX_PATH];
GetModuleFileName(hInstance, buffer, MAX_PATH);
@ -95,39 +102,36 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
}
}
if (loadTheme)
if (_wcsnicmp(lpCmdLine, L"/LoadTheme ", 11) == 0)
{
// Skip "/LOADTHEME "
// Skip "/LoadTheme "
lpCmdLine += 11;
if (CloseRainmeterIfActive() && *lpCmdLine)
{
LoadTheme(lpCmdLine);
CDialogInstall::LoadTheme(lpCmdLine, true);
std::wstring file = g_Data.programPath + L"Rainmeter.exe";
SHELLEXECUTEINFO sei = {0};
sei.cbSize = sizeof(SHELLEXECUTEINFO);
sei.fMask = SEE_MASK_UNICODE;
sei.lpFile = file.c_str();
sei.lpDirectory = g_Data.programPath.c_str();
sei.nShow = SW_SHOWNORMAL;
ShellExecuteEx(&sei);
}
return 0;
}
// Check whether Rainstaller.exe is already running and bring it to front if so
HANDLE hMutex;
if (IsRunning(L"RmSkinInstallerMutex", &hMutex))
else if (wcscmp(lpCmdLine, L"/BACKUP") == 0)
{
HWND hwnd = FindWindow(L"#32770", L"Backup Rainmeter");
SetForegroundWindow(hwnd);
return 0;
CDialogBackup::Create(hInstance, lpCmdLine);
}
else
{
CDialogInstall::Create(hInstance, lpCmdLine);
}
CDialogBackup::Create(hInstance, lpCmdLine);
ReleaseMutex(hMutex);
return 0;
}
@ -156,56 +160,6 @@ bool CloseRainmeterIfActive()
return true;
}
void LoadTheme(const WCHAR* name)
{
std::wstring backup = g_Data.settingsPath + L"Themes\\Backup";
CreateDirectory(backup.c_str(), NULL);
backup += L"\\Rainmeter.thm";
// Make a copy of current Rainmeter.ini
CopyFiles(g_Data.iniFile, backup);
// Replace Rainmeter.ini with theme
std::wstring theme = g_Data.settingsPath + L"Themes\\";
theme += name;
std::wstring wallpaper = theme + L"\\RainThemes.bmp";
theme += L"\\Rainmeter.thm";
if (CopyFiles(theme, g_Data.iniFile))
{
PreserveSetting(backup, L"SkinPath");
PreserveSetting(backup, L"ConfigEditor");
PreserveSetting(backup, L"LogViewer");
PreserveSetting(backup, L"Logging");
PreserveSetting(backup, L"DisableVersionCheck");
PreserveSetting(backup, L"Language");
PreserveSetting(backup, L"NormalStayDesktop");
PreserveSetting(backup, L"TrayExecuteL", false);
PreserveSetting(backup, L"TrayExecuteM", false);
PreserveSetting(backup, L"TrayExecuteR", false);
PreserveSetting(backup, L"TrayExecuteDM", false);
PreserveSetting(backup, L"TrayExecuteDR", false);
// Set wallpaper if it exists
if (_waccess(wallpaper.c_str(), 0) != -1)
{
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*)wallpaper.c_str(), SPIF_UPDATEINIFILE);
}
}
}
void PreserveSetting(const std::wstring& from, LPCTSTR key, bool replace)
{
WCHAR* buffer = new WCHAR[MAX_LINE_LENGTH];
if ((replace || GetPrivateProfileString(L"Rainmeter", key, L"", buffer, 4, g_Data.iniFile.c_str()) == 0) &&
GetPrivateProfileString(L"Rainmeter", key, L"", buffer, MAX_LINE_LENGTH, from.c_str()) > 0)
{
WritePrivateProfileString(L"Rainmeter", key, buffer, g_Data.iniFile.c_str());
}
delete buffer;
}
// -----------------------------------------------------------------------------------------------
// Stolen functions from Rainmeter Litestep.cpp, System.cpp, and Application.cpp
// -----------------------------------------------------------------------------------------------

View File

@ -16,8 +16,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __APPLICATION_H__
#define __APPLICATION_H__
#ifndef SKININSTALLER_APPLICATION_H_
#define SKININSTALLER_APPLICATION_H_
#include <string>
#include "zip.h"
@ -25,18 +25,14 @@
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#define MAX_LINE_LENGTH 4096
#define MB_ERROR MB_OK | MB_TOPMOST | MB_ICONERROR
#define MAX_LINE_LENGTH 4096
#define MB_ERROR MB_OK | MB_TOPMOST | MB_ICONERROR
struct GLOBALDATA
struct GlobalData
{
std::wstring programPath;
std::wstring settingsPath;
@ -53,8 +49,6 @@ enum OSPLATFORM
};
bool CloseRainmeterIfActive();
void LoadTheme(const WCHAR* name);
void PreserveSetting(const std::wstring& from, LPCTSTR key, bool replace = true);
OSPLATFORM GetOSPlatform();
bool IsRunning(const WCHAR* name, HANDLE* hMutex);

View File

@ -24,7 +24,7 @@
#define WM_DELAYED_CLOSE WM_APP + 0
extern GLOBALDATA g_Data;
extern GlobalData g_Data;
CDialogBackup* CDialogBackup::c_Dialog = NULL;
@ -54,7 +54,17 @@ CDialogBackup::~CDialogBackup()
*/
void CDialogBackup::Create(HINSTANCE hInstance, LPWSTR lpCmdLine)
{
DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_BACKUP_DIALOG), NULL, (DLGPROC)DlgProc, (LPARAM)lpCmdLine);
HANDLE hMutex;
if (IsRunning(L"RainmeterBackup", &hMutex))
{
HWND hwnd = FindWindow(L"#32770", L"Backup Rainmeter");
SetForegroundWindow(hwnd);
}
else
{
DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_BACKUP_DIALOG), NULL, (DLGPROC)DlgProc, (LPARAM)lpCmdLine);
ReleaseMutex(hMutex);
}
}
CDialog::CTab& CDialogBackup::GetActiveTab()
@ -99,7 +109,7 @@ INT_PTR CALLBACK CDialogBackup::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
INT_PTR CDialogBackup::OnInitDialog(WPARAM wParam, LPARAM lParam)
{
HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_INSTALLER), IMAGE_ICON, 16, 16, LR_SHARED);
HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_SKININSTALLER), IMAGE_ICON, 16, 16, LR_SHARED);
SendMessage(m_Window, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
if (GetOSPlatform() >= OSPLATFORM_VISTA)

View File

@ -16,8 +16,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _DIALOGBACKUP_H_
#define _DIALOGBACKUP_H_
#ifndef SKININSTALLER_DIALOGBACKUP_H_
#define SKININSTALLER_DIALOGBACKUP_H_
#include <string>
#include "zip.h"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,125 @@
/*
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"
class CDialogInstall : public CDialog
{
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);
static void LoadTheme(const std::wstring& name, bool setWallpaper);
static CDialogInstall* c_Dialog;
protected:
virtual CTab& GetActiveTab();
private:
class CTabInstall : public CTab
{
public:
CTabInstall(HWND window);
virtual void Initialize();
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(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];
};
CDialogInstall(HWND wnd, const WCHAR* file);
virtual ~CDialogInstall();
bool ReadPackage();
bool ReadOptions(const WCHAR* file);
bool InstallPackage();
void BeginInstall();
bool ExtractCurrentFile(const std::wstring& fileName);
static unsigned __stdcall InstallThread(void* pParam);
void LaunchRainmeter();
void KeepVariables();
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();
CTabInstall m_TabInstall;
HANDLE m_InstallThread;
std::wstring m_InstallTime;
std::wstring m_ErrorMessage;
bool m_BackupPackage;
unzFile m_PackageUnzFile;
std::wstring m_PackageFileName;
std::wstring m_PackageRoot;
PackageFormat m_PackageFormat;
std::set<std::wstring> m_PackageSkins;
std::set<std::wstring> m_PackageThemes;
std::set<std::wstring> m_PackageAddons;
std::set<std::wstring> m_PackageFonts;
std::set<std::wstring> m_PackagePlugins;
// Package options
bool m_MergeSkins;
std::vector<std::wstring> m_VariablesFiles;
std::vector<std::wstring> m_LoadSkins;
std::wstring m_LoadTheme;
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,104 +0,0 @@
/*
Copyright (C) 2011 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 __RAINSTALLER_H__
#define __RAINSTALLER_H__
#define OBJECT_NAME L"RainstallerObject_6D42B76464DA"
#define MB_ERROR MB_OK | MB_TOPMOST | MB_ICONERROR
#ifdef _WIN64
#define PLUGINS_ROOT L"Plugins/64bit/"
#else
#define PLUGINS_ROOT L"Plugins/32bit/"
#endif
typedef BOOL (WINAPI* CHECKTOKENMEMBERSHIP)(HANDLE tokenHandle, PSID sidToCheck, PBOOL isMember);
typedef BOOL (WINAPI* GETFONTRESOURCEINFO)(LPCTSTR lpszFilename, LPDWORD cbBuffer, LPVOID lpBuffer, DWORD dwQueryType);
enum INSTTYPE
{
INSTTYPE_ADMIN = 1, // Installs plugins, addons, and fonts
INSTTYPE_NOADMIN, // Installs skins and themes
INSTTYPE_FULL // Install all components
};
enum TIMER
{
TIMER_THREAD = 1,
TIMER_PROCESS
};
struct RMSKIN_DATA
{
INSTTYPE instType;
HANDLE instHandle;
int rootLen;
bool mergeSkins;
bool launchRainmeter;
bool rainmeterFonts;
std::wstring packageName;
std::wstring packageAuthor;
std::wstring packageVersion;
std::wstring rmskinFile;
std::wstring backupFolder;
std::wstring iniPath;
std::wstring skinsPath;
std::wstring rainmeterPath;
std::wstring addonsList;
std::wstring pluginsList;
std::wstring skinsList;
std::wstring themesList;
std::wstring fontsList;
std::wstring loadTheme;
std::wstring loadSkins;
std::wstring keepVariables;
};
int Rainstaller(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow);
BOOL CALLBACK DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK RunAsProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void InitDialog(HWND hwnd);
void InitInstall(HWND hwnd);
bool ReadArchive();
bool ReadSettings(LPCTSTR filePath);
bool ExtractCurrentFile(unzFile& ufile, LPCTSTR fileName);
bool IsDefaultPlugin(LPCTSTR plugin);
bool IsDefaultAddon(LPCTSTR addon);
HANDLE CreateProcessElevated(HWND hwnd);
unsigned __stdcall CreateInstallThread(void* pParam);
unsigned __stdcall SetRunAsThread(void*);
bool InstallComponents(RMSKIN_DATA* data);
bool BackupComponent(const std::wstring& backupFolder, const std::wstring& list, const std::wstring& path);
void KeepVariables(const std::wstring& backupFolder, const std::wstring& skinsPath, const std::wstring& fileList);
void LaunchRainmeter();
int CompareVersions(const std::wstring& strA, const std::wstring& strB);
std::vector<std::wstring> Tokenize(const std::wstring& str, const std::wstring& delimiters);
std::wstring GetDotNETVersion();
std::wstring GetFileVersion(const std::wstring& file);
std::wstring GetWindowsVersion();
BOOL IsCurrentProcessAdmin();
BOOL IsAboveVista();
BOOL IsActiveUAC();
#endif

View File

@ -11,7 +11,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,0,0,0
FILEVERSION 4,0,0,0
PRODUCTVERSION PRODUCTVER
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
@ -27,12 +27,11 @@ VS_VERSION_INFO VERSIONINFO
{
BLOCK "040904E4"
{
VALUE "FileDescription", "Rainstaller"
VALUE "FileVersion", "3.0.0.0"
VALUE "InternalName", "Rainstaller"
VALUE "LegalCopyright", "Copyright (C) 2011 - Birunthan Mohanathas"
VALUE "OriginalFilename", "Rainstaller.exe"
VALUE "ProductName", "Rainstaller"
VALUE "FileDescription", "Rainmeter Skin Installer"
VALUE "FileVersion", "4.0.0.0"
VALUE "LegalCopyright", "© 2012 - Birunthan Mohanathas"
VALUE "OriginalFilename", "SkinInstaller.exe"
VALUE "ProductName", "Rainmeter"
#ifdef _WIN64
VALUE "ProductVersion", STRPRODUCTVER " (64-bit)"
#else
@ -69,60 +68,41 @@ FONT 8, "MS Shell Dlg 2"
EDITTEXT IDC_BACKUP_FILE_TEXT, 0, 42, 220, 14, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "...", IDC_BACKUP_BROWSE_BUTTON, 225, 42, 25, 14, WS_TABSTOP
LTEXT "Backup in progress...\n\nThis may take several minutes to complete.", IDC_BACKUP_INPROGRESS_TEXT, 0, 0, 245, 39, NOT WS_VISIBLE
LTEXT "Backup in progress...", IDC_BACKUP_INPROGRESS_TEXT, 0, 0, 245, 9, NOT WS_VISIBLE
CONTROL "", IDC_BACKUP_PROGRESS, "msctls_progress32", PBS_MARQUEE | NOT WS_VISIBLE | WS_BORDER, 0, 42, 250, 11
}
IDD_INSTALLER_DIALOG DIALOGEX 0, 0, 266, 240
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
IDD_INSTALL_DIALOG DIALOGEX 0, 0, 266, 270
STYLE DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rainmeter Skin Installer"
FONT 8, "MS Shell Dlg 2"
{
CONTROL IDB_INSTALLHEADER, IDC_INSTALL_HEADER_BITMAP, STATIC, SS_BITMAP | WS_CHILD | WS_VISIBLE, 0, 0, 266, 37
CONTROL "", IDC_STATIC, STATIC, SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE, 0, 37, 270, 1
CONTROL "", IDC_INSTALL_TAB, "SysTabControl32", TCS_TABS | TCS_FIXEDWIDTH, 6, 42, 254, 205
PUSHBUTTON "Advanced", IDC_INSTALL_ADVANCED_BUTTON, 6, 251, 70, 14
DEFPUSHBUTTON "Install", IDC_INSTALL_INSTALL_BUTTON, 155, 251, 50, 14
PUSHBUTTON "Cancel", IDCLOSE, 210, 251, 50, 14
}
IDD_INSTALL_TAB DIALOGEX 15, 51, 236, 188
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
CAPTION "Rainstaller"
FONT 8, "MS Shell Dlg 2"
{
CONTROL IDB_INSTALLER, IDC_BITMAP, STATIC, SS_BITMAP | WS_CHILD | WS_VISIBLE, 0, 0, 266, 37
CONTROL "", IDC_STATIC, STATIC, SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE, 0, 37, 270, 1
GROUPBOX "", IDC_STATIC, 7, 39, 252, 44
LTEXT "Name:", IDC_NAME_LABEL, 13, 48, 35, 9
LTEXT "", IDC_NAME_VALUE, 50, 48, 200, 9, SS_NOPREFIX
LTEXT "Author:", IDC_AUTHOR_LABEL, 13, 59, 35, 9
LTEXT "", IDC_AUTHOR_VALUE, 50, 59, 200, 9, SS_NOPREFIX
LTEXT "Version:", IDC_VERSION_LABEL, 13, 70, 35, 9
LTEXT "", IDC_VERSION_VALUE, 50, 70, 200, 9, SS_NOPREFIX
GROUPBOX "", IDC_STATIC, 7, 83, 252, 95
LTEXT "Skins:", IDC_SKINS_LABEL, 13, 91, 35, 9, SS_NOTIFY
LTEXT "", IDC_SKINS_VALUE, 50, 91, 200, 9, SS_NOTIFY | SS_ENDELLIPSIS | SS_NOPREFIX
LTEXT "Themes:", IDC_THEMES_LABEL, 13, 102, 35, 9, SS_NOTIFY
LTEXT "", IDC_THEMES_VALUE, 50, 102, 200, 9, SS_NOTIFY | SS_ENDELLIPSIS | SS_NOPREFIX
LTEXT "Addons:", IDC_ADDONS_LABEL, 13, 113, 35, 9, SS_NOTIFY
LTEXT "", IDC_ADDONS_VALUE, 50, 113, 200, 9, SS_NOTIFY | SS_ENDELLIPSIS | SS_NOPREFIX
LTEXT "Plugins:", IDC_PLUGINS_LABEL, 13, 124, 35, 9, SS_NOTIFY
LTEXT "", IDC_PLUGINS_VALUE, 50, 124, 200, 9, SS_NOTIFY | SS_ENDELLIPSIS | SS_NOPREFIX
LTEXT "Fonts:", IDC_FONTS_LABEL, 13, 135, 35, 9, SS_NOTIFY
LTEXT "", IDC_FONTS_VALUE, 50, 135, 200, 9, SS_NOTIFY | SS_ENDELLIPSIS | SS_NOPREFIX
AUTOCHECKBOX "Apply theme ()", IDC_THEME_CHECKBOX, 13, 150, 220, 9, BST_CHECKED
AUTOCHECKBOX "Launch Rainmeter after install", IDC_LAUNCH_CHECKBOX, 13, 162, 220, 9, BST_CHECKED
CONTROL "", IDC_PROGRESSBAR, "msctls_progress32", PBS_MARQUEE | WS_CHILD | WS_VISIBLE | WS_BORDER, 7, 186, 135, 11
DEFPUSHBUTTON "&Install", IDC_INSTALL_BUTTON, 155, 184, 50, 14
PUSHBUTTON "&Cancel", IDC_CANCEL_BUTTON, 209, 184, 50, 14
CONTROL "", IDC_SEPERATOR, STATIC, SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE, 0, 204, 270, 1
ICON "", IDC_WARNING_ICON, 8, 212, 20, 20
LTEXT "Components marked with an asterisk (*) will be replaced. Backups will be made should you want to restore.", IDC_BACKUP_LABEL, 38, 213, 220, 18
}
LTEXT "The following package is about to be installed.", IDC_STATIC, 0, 0, 231, 39
LTEXT "Name:", IDC_STATIC, 0, 20, 35, 9
LTEXT "", IDC_INSTALLTAB_NAME_TEXT, 50, 20, 200, 9, SS_NOPREFIX
LTEXT "Author:", IDC_STATIC, 0, 33, 35, 9
LTEXT "", IDC_INSTALLTAB_AUTHOR_TEXT, 50, 33, 200, 9, SS_NOPREFIX
LTEXT "Version:", IDC_STATIC, 0, 46, 35, 9
LTEXT "", IDC_INSTALLTAB_VERSION_TEXT, 50, 46, 200, 9, SS_NOPREFIX
LTEXT "Included components:", IDC_STATIC, 0, 65, 80, 9
CONTROL "", IDC_INSTALLTAB_COMPONENTS_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 0, 80, 234, 86
AUTOCHECKBOX "Apply included theme", IDC_INSTALLTAB_THEME_CHECKBOX, 4, 175, 220, 9
IDD_RUNAS DIALOGEX 0, 0, 250, 145
STYLE DS_MODALFRAME | DS_CENTER | DS_NOIDLEMSG | DS_SETFOREGROUND | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Run As..."
FONT 8, "MS Shell Dlg 2"
{
ICON "", IDC_KEY_ICON, 7, 8, 20, 20
LTEXT "You do not have the necessary permissions to install the components. You need to run this program as a different administrative user in order to continue with the installation.", IDC_HELPTEXT, 38, 7, 204, 35
CONTROL "&Current user", IDC_CURRENT_BUTTON, "Button", BS_AUTORADIOBUTTON | WS_DISABLED, 20, 49, 218, 10
CONTROL "Run the program as the &following user:", IDC_SPECIFIED_BUTTON, "Button", BS_AUTORADIOBUTTON, 20, 65, 218, 10
LTEXT "&User name:", IDC_USERNAME_LABEL, 20, 84, 42, 16
EDITTEXT IDC_USERNAME, 63, 83, 175, 14, ES_AUTOHSCROLL
LTEXT "&Password:", IDC_PASSWORD_LABEL, 20, 102, 42, 20
EDITTEXT IDC_PASSWORD, 63, 100, 175, 14, ES_PASSWORD | ES_AUTOHSCROLL
DEFPUSHBUTTON "&OK", IDOK, 132, 122, 50, 14
PUSHBUTTON "Ca&ncel", IDCANCEL, 188, 122, 50, 14
LTEXT "Installing...", IDC_INSTALLTAB_INPROGRESS_TEXT, 0, 0, 236, 60, NOT WS_VISIBLE
CONTROL "", IDC_INSTALLTAB_PROGRESS, "msctls_progress32", PBS_MARQUEE | NOT WS_VISIBLE | WS_BORDER, 0, 15, 236, 11
}
/////////////////////////////////////////////////////////////////////////////
@ -130,11 +110,11 @@ FONT 8, "MS Shell Dlg 2"
// Bitmap
//
IDB_INSTALLER BITMAP "res/Rainstaller.bmp"
IDB_INSTALLHEADER BITMAP "res/Rainstaller.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
IDI_INSTALLER ICON DISCARDABLE "res/Rainstaller.ico"
IDI_SKININSTALLER ICON DISCARDABLE "res/Rainstaller.ico"

View File

@ -84,9 +84,9 @@
</MASM>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;ZLIB_WINAPI;NOUNCRYPT;NOCRYPT;ASMV;ASMINF;NOOLDPENTIUMCODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;ZLIB_WINAPI;NOUNCRYPT;NOCRYPT;ASMV;ASMINF;NOOLDPENTIUMCODE;HAVE_CONFIG_H;SUPPORT_UTF8;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4530;4996</DisableSpecificWarnings>
<DisableSpecificWarnings>4244;4267;4482;4530;4996</DisableSpecificWarnings>
<AdditionalIncludeDirectories>./zlib;./zlib/minizip</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
@ -100,8 +100,8 @@
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Version.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Rainmeter.lib;Wininet.lib;Comctl32.lib;Version.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\Library\x32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>
<MergeSections>.rdata=.text</MergeSections>
<OptimizeReferences>true</OptimizeReferences>
@ -120,9 +120,9 @@
</MASM>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;ZLIB_WINAPI;NOUNCRYPT;NOCRYPT;ASMV;ASMINF;NOOLDPENTIUMCODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;ZLIB_WINAPI;NOUNCRYPT;NOCRYPT;ASMV;ASMINF;NOOLDPENTIUMCODE;HAVE_CONFIG_H;SUPPORT_UTF8;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4244;4267;4530;4996</DisableSpecificWarnings>
<DisableSpecificWarnings>4244;4267;4482;4530;4996</DisableSpecificWarnings>
<AdditionalIncludeDirectories>./zlib;./zlib/minizip</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
@ -135,8 +135,8 @@
<OutputFile>..\TestBench\x64\$(Configuration)\SkinInstaller.exe</OutputFile>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Version.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Rainmeter.lib;Wininet.lib;Comctl32.lib;Version.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\Library\x64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>
<MergeSections>.rdata=.text</MergeSections>
<OptimizeReferences>true</OptimizeReferences>
@ -155,13 +155,13 @@
</MASM>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;ZLIB_WINAPI;NOUNCRYPT;NOCRYPT;ASMV;ASMINF;NOOLDPENTIUMCODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;ZLIB_WINAPI;NOUNCRYPT;NOCRYPT;ASMV;ASMINF;NOOLDPENTIUMCODE;HAVE_CONFIG_H;SUPPORT_UTF8;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<AdditionalIncludeDirectories>./zlib;./zlib/minizip</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4244;4267;4530;4996</DisableSpecificWarnings>
<DisableSpecificWarnings>4244;4267;4482;4530;4996</DisableSpecificWarnings>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
</ClCompile>
<ResourceCompile>
@ -175,8 +175,8 @@
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<TargetMachine>MachineX86</TargetMachine>
<EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>
<AdditionalDependencies>Version.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Rainmeter.lib;Wininet.lib;Comctl32.lib;Version.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\Library\x32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
</Link>
<Bscmake>
@ -189,12 +189,12 @@
</MASM>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;ZLIB_WINAPI;NOUNCRYPT;NOCRYPT;ASMV;ASMINF;NOOLDPENTIUMCODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;ZLIB_WINAPI;NOUNCRYPT;NOCRYPT;ASMV;ASMINF;NOOLDPENTIUMCODE;HAVE_CONFIG_H;SUPPORT_UTF8;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>./zlib;./zlib/minizip</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4244;4267;4530;4996</DisableSpecificWarnings>
<DisableSpecificWarnings>4244;4267;4482;4530;4996</DisableSpecificWarnings>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
</ClCompile>
<ResourceCompile>
@ -207,8 +207,8 @@
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>
<AdditionalDependencies>Version.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Rainmeter.lib;Wininet.lib;Comctl32.lib;Version.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\Library\x64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
</Link>
<Bscmake>
@ -219,7 +219,7 @@
<ClCompile Include="..\Library\Dialog.cpp" />
<ClCompile Include="Application.cpp" />
<ClCompile Include="DialogBackup.cpp" />
<ClCompile Include="Rainstaller.cpp" />
<ClCompile Include="DialogInstall.cpp" />
<ClCompile Include="StdAfx.cpp" />
<ClCompile Include="zlib\adler32.c" />
<ClCompile Include="zlib\crc32.c" />
@ -237,6 +237,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\Library\pcre-8.10\pcre_globals.c" />
<ClCompile Include="zlib\inflate.c" />
<ClCompile Include="zlib\inftrees.c" />
<ClCompile Include="zlib\minizip\ioapi.c" />
@ -254,9 +255,13 @@
<ClInclude Include="..\Library\Dialog.h" />
<ClInclude Include="Application.h" />
<ClInclude Include="DialogBackup.h" />
<ClInclude Include="Rainstaller.h" />
<ClInclude Include="DialogInstall.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="StdAfx.h" />
<ClInclude Include="..\Library\pcre-8.10\config.h" />
<ClInclude Include="..\Library\pcre-8.10\pcre.h" />
<ClInclude Include="..\Library\pcre-8.10\pcre_internal.h" />
<ClInclude Include="..\Library\pcre-8.10\ucp.h" />
<ClInclude Include="zlib\crc32.h" />
<ClInclude Include="zlib\deflate.h" />
<ClInclude Include="zlib\inffast.h" />

View File

@ -19,6 +19,9 @@
<Filter Include="zlib\minizip">
<UniqueIdentifier>{b726e25d-2977-424a-b45b-8ee60ce6bd49}</UniqueIdentifier>
</Filter>
<Filter Include="pcre">
<UniqueIdentifier>{73cc243e-5b60-4fbc-ae48-069c6decc4ed}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Application.cpp">
@ -78,9 +81,12 @@
<ClCompile Include="..\Library\Dialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Rainstaller.cpp">
<ClCompile Include="DialogInstall.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\Library\pcre-8.10\pcre_globals.c">
<Filter>pcre</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h">
@ -134,9 +140,21 @@
<ClInclude Include="..\Library\Dialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Rainstaller.h">
<ClInclude Include="DialogInstall.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\Library\pcre-8.10\pcre.h">
<Filter>pcre</Filter>
</ClInclude>
<ClInclude Include="..\Library\pcre-8.10\pcre_internal.h">
<Filter>pcre</Filter>
</ClInclude>
<ClInclude Include="..\Library\pcre-8.10\ucp.h">
<Filter>pcre</Filter>
</ClInclude>
<ClInclude Include="..\Library\pcre-8.10\config.h">
<Filter>pcre</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="Res\SkinInstaller.ico">

View File

@ -20,22 +20,27 @@
#define __STDAFX_H__
// WINAPI
#include <windows.h>
#include <windowsx.h>
#include <shlobj.h>
#include <shlwapi.h>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Windowsx.h>
#include <Commdlg.h>
#include <Shlobj.h>
#include <Shlwapi.h>
#include <Shellapi.h>
#include <Wininet.h>
// STL
#include <string>
#include <vector>
#include <list>
#include <set>
#include <vector>
#include <ctime>
#include <cstdlib>
#include <cerrno>
#include <cctype>
// RUNTIME
#include <stdio.h>
#include <errno.h>
#include <process.h>
#endif

View File

@ -1,8 +1,8 @@
#define IDC_STATIC -1
#define IDI_INSTALLER 100
#define IDB_INSTALLER 101
#define IDD_INSTALLER_DIALOG 102
#define IDD_INSTALLER_TAB 103
#define IDI_SKININSTALLER 100
#define IDB_INSTALLHEADER 101
#define IDD_INSTALL_DIALOG 102
#define IDD_INSTALL_TAB 103
#define IDD_BACKUP_DIALOG 104
#define IDD_BACKUP_TABDIALOG 105
@ -14,39 +14,15 @@
#define IDC_BACKUP_DESCRIPTION_TEXT 1024
#define IDC_BACKUP_INPROGRESS_TEXT 1025
// Rainstaller
#define IDC_BITMAP 1000
#define IDC_NAME_LABEL 1001
#define IDC_NAME_VALUE 1002
#define IDC_AUTHOR_LABEL 1003
#define IDC_AUTHOR_VALUE 1004
#define IDC_VERSION_LABEL 1005
#define IDC_VERSION_VALUE 1006
#define IDC_SKINS_LABEL 1007
#define IDC_SKINS_VALUE 1008
#define IDC_THEMES_LABEL 1009
#define IDC_THEMES_VALUE 1010
#define IDC_ADDONS_LABEL 1011
#define IDC_ADDONS_VALUE 1012
#define IDC_PLUGINS_LABEL 1013
#define IDC_PLUGINS_VALUE 1014
#define IDC_FONTS_LABEL 1015
#define IDC_FONTS_VALUE 1016
#define IDC_THEME_CHECKBOX 1017
#define IDC_LAUNCH_CHECKBOX 1018
#define IDC_BACKUP_LABEL 1019
#define IDC_PROGRESSBAR 1020
#define IDC_INSTALL_BUTTON 1021
#define IDC_CANCEL_BUTTON 1022
#define IDC_SEPERATOR 1023
#define IDC_WARNING_ICON 1024
#define IDC_INSTALL_TAB 1000
#define IDC_INSTALL_HEADER_BITMAP 1001
#define IDC_INSTALL_ADVANCED_BUTTON 1002
#define IDC_INSTALL_INSTALL_BUTTON 1003
#define IDD_RUNAS 111
#define IDC_CURRENT_BUTTON 1100
#define IDC_SPECIFIED_BUTTON 1101
#define IDC_KEY_ICON 1102
#define IDC_HELPTEXT 1103
#define IDC_USERNAME 1104
#define IDC_PASSWORD 1105
#define IDC_USERNAME_LABEL 1107
#define IDC_PASSWORD_LABEL 1108
#define IDC_INSTALLTAB_NAME_TEXT 1000
#define IDC_INSTALLTAB_AUTHOR_TEXT 1001
#define IDC_INSTALLTAB_VERSION_TEXT 1002
#define IDC_INSTALLTAB_COMPONENTS_LIST 1003
#define IDC_INSTALLTAB_THEME_CHECKBOX 1004
#define IDC_INSTALLTAB_INPROGRESS_TEXT 1005
#define IDC_INSTALLTAB_PROGRESS 1006