Skip to content

Commit

Permalink
Merge SkinInstaller.dll into Rainmeter.dll
Browse files Browse the repository at this point in the history
  • Loading branch information
poiru committed Dec 26, 2015
1 parent 84cdecf commit 9fd12f1
Show file tree
Hide file tree
Showing 32 changed files with 311 additions and 2,846 deletions.
2 changes: 1 addition & 1 deletion Build/Installer/Installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ FunctionEnd
File "..\..\${DIR}-Release\Rainmeter.exe"
File "..\..\${DIR}-Release\Rainmeter.dll"
File "..\..\${DIR}-Release\SkinInstaller.exe"
File "..\..\${DIR}-Release\SkinInstaller.dll"

SetOutPath "$INSTDIR\Plugins"
File /x *Example*.dll "..\..\${DIR}-Release\Plugins\*.dll"
Expand Down Expand Up @@ -627,6 +626,7 @@ SkipIniMove:
Delete "$INSTDIR\Rainmeter.chm"
Delete "$INSTDIR\Default.ini"
Delete "$INSTDIR\Launcher.exe"
Delete "$INSTDIR\SkinInstaller.dll"
Delete "$INSTDIR\Defaults\Plugins\FileView.dll"
RMDir /r "$INSTDIR\Addons\Rainstaller"
RMDir /r "$INSTDIR\Addons\RainBackup"
Expand Down
24 changes: 12 additions & 12 deletions Library/Dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include "StdAfx.h"
#include "Dialog.h"

HWND Dialog::c_ActiveDialogWindow = nullptr;
HWND Dialog::c_ActiveTabWindow = nullptr;
HWND OldDialog::c_ActiveDialogWindow = nullptr;
HWND OldDialog::c_ActiveTabWindow = nullptr;

Dialog::Dialog(HWND wnd) :
OldDialog::OldDialog(HWND wnd) :
m_Window(wnd),
m_Font(),
m_FontBold()
Expand All @@ -29,13 +29,13 @@ Dialog::Dialog(HWND wnd) :
** Destructor.
**
*/
Dialog::~Dialog()
OldDialog::~OldDialog()
{
DeleteObject(m_Font);
DeleteObject(m_FontBold);
}

INT_PTR Dialog::OnActivate(WPARAM wParam, LPARAM lParam)
INT_PTR OldDialog::OnActivate(WPARAM wParam, LPARAM lParam)
{
if (wParam)
{
Expand All @@ -54,12 +54,12 @@ INT_PTR Dialog::OnActivate(WPARAM wParam, LPARAM lParam)
** Sets dialog font to UI font.
**
*/
void Dialog::SetDialogFont(HWND window)
void OldDialog::SetDialogFont(HWND window)
{
EnumChildWindows(window, SetFontProc, (WPARAM)m_Font);
}

BOOL CALLBACK Dialog::SetFontProc(HWND hWnd, LPARAM lParam)
BOOL CALLBACK OldDialog::SetFontProc(HWND hWnd, LPARAM lParam)
{
SendMessage(hWnd, WM_SETFONT, (WPARAM)lParam, 0);
return TRUE;
Expand All @@ -69,12 +69,12 @@ BOOL CALLBACK Dialog::SetFontProc(HWND hWnd, LPARAM lParam)
** Subclass button control to draw arrow on the right.
**
*/
void Dialog::SetMenuButton(HWND button)
void OldDialog::SetMenuButton(HWND button)
{
SetWindowSubclass(button, MenuButtonProc, 0, 0);
}

LRESULT CALLBACK Dialog::MenuButtonProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
LRESULT CALLBACK OldDialog::MenuButtonProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
{
LRESULT result = DefSubclassProc(hWnd, uMsg, wParam, lParam);

Expand Down Expand Up @@ -120,7 +120,7 @@ LRESULT CALLBACK Dialog::MenuButtonProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
return result;
}

Dialog::Tab::Tab(HINSTANCE instance, HWND owner, WORD tabId, DLGPROC tabProc) :
OldDialog::Tab::Tab(HINSTANCE instance, HWND owner, WORD tabId, DLGPROC tabProc) :
m_Window(CreateDialog(instance, MAKEINTRESOURCE(tabId), owner, tabProc)),
m_Initialized(false)
{
Expand All @@ -131,7 +131,7 @@ Dialog::Tab::Tab(HINSTANCE instance, HWND owner, WORD tabId, DLGPROC tabProc) :
** Destructor.
**
*/
Dialog::Tab::~Tab()
OldDialog::Tab::~Tab()
{
DestroyWindow(m_Window);
}
Expand All @@ -140,7 +140,7 @@ Dialog::Tab::~Tab()
** Activates the tab.
**
*/
void Dialog::Tab::Activate()
void OldDialog::Tab::Activate()
{
c_ActiveTabWindow = m_Window;

Expand Down
6 changes: 3 additions & 3 deletions Library/Dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef __DIALOG_H__
#define __DIALOG_H__

class Dialog
class OldDialog
{
public:
HWND GetWindow() { return m_Window; }
Expand All @@ -35,8 +35,8 @@ class Dialog
bool m_Initialized;
};

Dialog(HWND wnd);
virtual ~Dialog();
OldDialog(HWND wnd);
virtual ~OldDialog();

virtual HWND GetActiveWindow() { return m_Window; }

Expand Down
6 changes: 3 additions & 3 deletions SkinInstaller/DialogInstall.cpp → Library/DialogInstall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ inline bool IsWin32Build()
** Constructor.
**
*/
DialogInstall::DialogInstall(HWND wnd, const WCHAR* file) : Dialog(wnd),
DialogInstall::DialogInstall(HWND wnd, const WCHAR* file) : OldDialog(wnd),
m_TabInstall(wnd),
m_HeaderBitmap(),
m_InstallThread(),
Expand Down Expand Up @@ -99,7 +99,7 @@ void DialogInstall::Create(HINSTANCE hInstance, LPWSTR lpCmdLine)
}
}

Dialog::Tab& DialogInstall::GetActiveTab()
OldDialog::Tab& DialogInstall::GetActiveTab()
{
return m_TabInstall;
}
Expand Down Expand Up @@ -149,7 +149,7 @@ INT_PTR DialogInstall::OnInitDialog(WPARAM wParam, LPARAM lParam)
}

HWND item = GetDlgItem(m_Window, IDC_INSTALL_ADVANCED_BUTTON);
Dialog::SetMenuButton(item);
OldDialog::SetMenuButton(item);

if (ReadPackage())
{
Expand Down
4 changes: 2 additions & 2 deletions SkinInstaller/DialogInstall.h → Library/DialogInstall.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

#include <string>
#include "unzip.h"
#include "../Library/Dialog.h"
#include "Dialog.h"

class DialogInstall : public Dialog
class DialogInstall : public OldDialog
{
public:
static void Create(HINSTANCE hInstance, LPWSTR lpCmdLine);
Expand Down
4 changes: 2 additions & 2 deletions SkinInstaller/DialogPackage.cpp → Library/DialogPackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern OsNameVersion g_OsNameVersions[];

DialogPackage* DialogPackage::c_Dialog = nullptr;

DialogPackage::DialogPackage(HWND wnd) : Dialog(wnd),
DialogPackage::DialogPackage(HWND wnd) : OldDialog(wnd),
m_TabInfo(wnd),
m_TabOptions(wnd),
m_TabAdvanced(wnd),
Expand Down Expand Up @@ -51,7 +51,7 @@ void DialogPackage::Create(HINSTANCE hInstance, LPWSTR lpCmdLine)
}
}

Dialog::Tab& DialogPackage::GetActiveTab()
OldDialog::Tab& DialogPackage::GetActiveTab()
{
int sel = TabCtrl_GetCurSel(GetDlgItem(m_Window, IDC_PACKAGE_TAB));
if (sel == -1)
Expand Down
4 changes: 2 additions & 2 deletions SkinInstaller/DialogPackage.h → Library/DialogPackage.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

#include <string>
#include "zip.h"
#include "../Library/Dialog.h"
#include "Dialog.h"

class DialogPackage : public Dialog
class DialogPackage : public OldDialog
{
public:
static void Create(HINSTANCE hInstance, LPWSTR lpCmdLine);
Expand Down
3 changes: 3 additions & 0 deletions Library/Exports.def
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ EXPORTS

; Private
RainmeterMain @1 NONAME

; 2-4 were for the non-UTF-16 pcre_ functions.
pcre16_compile @5 NONAME
pcre16_exec @6 NONAME
pcre16_study @7 NONAME

SkinInstallerMain @8 NONAME
155 changes: 154 additions & 1 deletion Library/Library.rc
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,157 @@ VS_VERSION_INFO VERSIONINFO
IDR_DIALOG_ACCELERATORS ACCELERATORS
{
"^C", IDM_COPY
}
}

/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDR_INSTALL_MENU MENU
{
POPUP " "
{
MENUITEM "Backup skins", IDM_INSTALL_BACKUPSKINS
MENUITEM "Install fonts to system", IDM_INSTALL_SYSTEMFONTS, GRAYED
MENUITEM SEPARATOR
MENUITEM " ", IDM_INSTALL_FORMAT, GRAYED
}
}

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_PACKAGE_DIALOG DIALOGEX 0, 0, 300, 280
STYLE DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rainmeter Skin Packager"
FONT 8, "MS Shell Dlg 2"
{
CONTROL "", IDC_PACKAGE_TAB, "SysTabControl32", TCS_TABS | TCS_FIXEDWIDTH, 6, 6, 288, 251
DEFPUSHBUTTON "Next", IDC_PACKAGE_NEXT_BUTTON, 188, 261, 50, 14, WS_DISABLED
PUSHBUTTON "Create package", IDC_PACKAGE_CREATEPACKAGE_BUTTON, 158, 261, 80, 14, NOT WS_VISIBLE
PUSHBUTTON "Cancel", IDCANCEL, 243, 261, 50, 14
}

IDD_PACKAGEINFO_TAB DIALOGEX 15, 15, 270, 235
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg 2"
{
LTEXT "Enter the information and select the components to use for the .rmskin package.", IDC_STATIC, 0, 0, 264, 19

GROUPBOX "Information", IDC_STATIC, 0, 35, 270, 70
LTEXT "Name:", IDC_STATIC, 6, 51, 35, 9
EDITTEXT IDC_PACKAGEINFO_NAME_EDIT, 56, 48, 208, 14
LTEXT "Author:", IDC_STATIC, 6, 69, 35, 9
EDITTEXT IDC_PACKAGEINFO_AUTHOR_EDIT, 56, 66, 208, 14
LTEXT "Version:", IDC_STATIC, 6, 87, 35, 9
EDITTEXT IDC_PACKAGEINFO_VERSION_EDIT, 56, 83, 140, 14

GROUPBOX "Components", IDC_STATIC, 0, 110, 270, 108
CONTROL "", IDC_PACKAGEINFO_COMPONENTS_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 6, 125, 182, 86
PUSHBUTTON "Add skin...", IDC_PACKAGEINFO_ADDSKIN_BUTTON, 194, 125, 70, 14
PUSHBUTTON "Add layout...", IDC_PACKAGEINFO_ADDTHEME_BUTTON, 194, 144, 70, 14
PUSHBUTTON "Add plugin...", IDC_PACKAGEINFO_ADDPLUGIN_BUTTON, 194, 162, 70, 14
PUSHBUTTON "Remove", IDC_PACKAGEINFO_REMOVE_BUTTON, 194, 197, 70, 14, WS_DISABLED
CONTROL "<A>What is a .rmskin package?</A>", IDC_PACKAGEINFO_WHATIS_LINK, "SysLink", 0x0, 0, 225, 264, 9
}

IDD_PACKAGEOPTIONS_TAB DIALOGEX 15, 30, 270, 220
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg 2"
{
LTEXT "Save package to:", IDC_STATIC, 0, 0, 264, 9
EDITTEXT IDC_PACKAGEOPTIONS_FILE_EDIT, 0, 17, 240, 14, ES_READONLY | ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
PUSHBUTTON "...", IDC_PACKAGEOPTIONS_FILEBROWSE_BUTTON, 245, 17, 25, 14, WS_TABSTOP


GROUPBOX "After installation", IDC_STATIC, 0, 101, 270, 58
AUTORADIOBUTTON "Do nothing", IDC_PACKAGEOPTIONS_DONOTHING_RADIO, 6, 116, 85, 9, WS_TABSTOP
AUTORADIOBUTTON "Load skin", IDC_PACKAGEOPTIONS_LOADSKIN_RADIO, 6, 129, 85, 9, WS_TABSTOP
EDITTEXT IDC_PACKAGEOPTIONS_LOADSKIN_EDIT, 96, 126, 138, 14, ES_READONLY | ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | NOT WS_VISIBLE
PUSHBUTTON "...", IDC_PACKAGEOPTIONS_LOADSKINBROWSE_BUTTON, 239, 126, 25, 14, WS_TABSTOP | NOT WS_VISIBLE
AUTORADIOBUTTON "Load layout", IDC_PACKAGEOPTIONS_LOADTHEME_RADIO, 6, 142, 85, 9, WS_TABSTOP
COMBOBOX IDC_PACKAGEOPTIONS_LOADTHEME_COMBO, 96, 139, 168, 14, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | NOT WS_VISIBLE

GROUPBOX "Minimum requirements", IDC_STATIC, 0, 164, 270, 53
LTEXT "Rainmeter version:", IDC_STATIC, 6, 180, 85, 9
EDITTEXT IDC_PACKAGEOPTIONS_RAINMETERVERSION_EDIT, 96, 177, 80, 14
LTEXT "Windows version:", IDC_STATIC, 6, 198, 85, 9
COMBOBOX IDC_PACKAGEOPTIONS_WINDOWSVERSION_COMBO, 96, 195, 80, 14, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP

LTEXT "Creating...", IDC_INSTALLTAB_CREATING_TEXT, 0, 0, 270, 100, NOT WS_VISIBLE
CONTROL "", IDC_INSTALLTAB_CREATING_BAR, "msctls_progress32", PBS_MARQUEE | NOT WS_VISIBLE | WS_BORDER, 0, 15, 270, 11
}

IDD_PACKAGEADVANCED_TAB DIALOGEX 15, 30, 270, 220
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg 2"
{
LTEXT "Header image:", IDC_STATIC, 0, 3, 85, 9
EDITTEXT IDC_PACKAGEADVANCED_HEADER_EDIT, 90, 0, 150, 14, ES_READONLY | ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "...", IDC_PACKAGEADVANCED_HEADERROWSE_BUTTON, 245, 0, 25, 14, WS_TABSTOP
LTEXT "Variables files:", IDC_STATIC, 0, 24, 85, 9
EDITTEXT IDC_PACKAGEADVANCED_VARIABLEFILES_EDIT, 90, 21, 180, 14, ES_AUTOHSCROLL | WS_TABSTOP
AUTOCHECKBOX "Merge skins", IDC_PACKAGEADVANCED_MERGESKINS_CHECK, 0, 42, 85, 9, WS_TABSTOP
CONTROL "<A>Help</A>", IDC_PACKAGEADVANCED_HELP_LINK, "SysLink", 0x0, 0, 210, 264, 9
}

IDD_PACKAGESELECTFOLDER_DIALOG DIALOGEX 0, 0, 200, 100
STYLE DS_CENTER | WS_POPUP | WS_TILEDWINDOW
EXSTYLE WS_EX_TOOLWINDOW
CAPTION "Add"
FONT 8, "MS Shell Dlg 2"
{
AUTORADIOBUTTON "", IDC_PACKAGESELECTFOLDER_EXISTING_RADIO, 6, 6, 220, 9, WS_TABSTOP | BST_CHECKED
COMBOBOX IDC_PACKAGESELECTFOLDER_EXISTING_COMBO, 16, 19, 177, 14, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
AUTORADIOBUTTON "Add custom folder:", IDC_PACKAGESELECTFOLDER_CUSTOM_RADIO, 6, 40, 220, 9, WS_TABSTOP
EDITTEXT IDC_PACKAGESELECTFOLDER_CUSTOM_EDIT, 16, 53, 149, 14, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL | WS_DISABLED
PUSHBUTTON "...", IDC_PACKAGESELECTFOLDER_CUSTOMBROWSE_BUTTON, 170, 53, 25, 14, WS_TABSTOP | WS_DISABLED
DEFPUSHBUTTON "Add", IDOK, 146, 82, 50, 14
}

IDD_PACKAGESELECTPLUGIN_DIALOG DIALOGEX 0, 0, 200, 100
STYLE DS_CENTER | WS_POPUP | WS_TILEDWINDOW
EXSTYLE WS_EX_TOOLWINDOW
CAPTION "Add"
FONT 8, "MS Shell Dlg 2"
{
LTEXT "32-bit DLL:", IDC_STATIC, 6, 6, 220, 9
EDITTEXT IDC_PACKAGESELECTPLUGIN_32BIT_EDIT, 16, 19, 149, 14, ES_READONLY | WS_BORDER
PUSHBUTTON "...", IDC_PACKAGESELECTPLUGIN_32BITBROWSE_BUTTON, 170, 19, 25, 14, WS_TABSTOP
LTEXT "64-bit DLL:", IDC_STATIC, 6, 40, 220, 9
EDITTEXT IDC_PACKAGESELECTPLUGIN_64BIT_EDIT, 16, 53, 149, 14, ES_READONLY | WS_BORDER
PUSHBUTTON "...", IDC_PACKAGESELECTPLUGIN_64BITBROWSE_BUTTON, 170, 53, 25, 14, WS_TABSTOP
DEFPUSHBUTTON "Add", IDOK, 146, 82, 50, 14, WS_DISABLED
}

IDD_INSTALL_DIALOG DIALOGEX 0, 0, 266, 250
STYLE DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rainmeter Skin Installer"
FONT 8, "MS Shell Dlg 2"
{
CONTROL 0, IDC_INSTALL_HEADER_BITMAP, STATIC, SS_BITMAP | WS_CHILD | WS_VISIBLE, 0, 0, 266, 37
CONTROL "", IDC_INSTALL_TAB, "SysTabControl32", TCS_TABS | TCS_FIXEDWIDTH, 6, 42, 254, 185
PUSHBUTTON "Advanced", IDC_INSTALL_ADVANCED_BUTTON, 6, 231, 70, 14
DEFPUSHBUTTON "Install", IDC_INSTALL_INSTALL_BUTTON, 155, 231, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 210, 231, 50, 14
}

IDD_INSTALL_TAB DIALOGEX 15, 51, 236, 168
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg 2"
{
LTEXT "Name:", IDC_STATIC, 0, 0, 35, 9
LTEXT "", IDC_INSTALLTAB_NAME_TEXT, 50, 0, 200, 9, SS_NOPREFIX
LTEXT "Author:", IDC_STATIC, 0, 13, 35, 9
LTEXT "", IDC_INSTALLTAB_AUTHOR_TEXT, 50, 13, 200, 9, SS_NOPREFIX
LTEXT "Version:", IDC_STATIC, 0, 26, 35, 9
LTEXT "", IDC_INSTALLTAB_VERSION_TEXT, 50, 26, 200, 9, SS_NOPREFIX
LTEXT "Included components:", IDC_STATIC, 0, 45, 80, 9
CONTROL "", IDC_INSTALLTAB_COMPONENTS_LIST, "SysListView32", LVS_REPORT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 0, 60, 234, 86
AUTOCHECKBOX "Apply included layout", IDC_INSTALLTAB_THEME_CHECKBOX, 4, 155, 220, 9
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
}
Loading

0 comments on commit 9fd12f1

Please sign in to comment.