Windows7 JumpList now also shows list of 6 most visited pages, added
variety of icons sizes, updated windows installer
21
src/3rdparty/qtwin.cpp
vendored
@ -30,6 +30,8 @@
|
||||
#include <QWidget>
|
||||
#include <QList>
|
||||
#include <QPointer>
|
||||
#include "historymodel.h"
|
||||
#include "mainapplication.h"
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
#include <qt_windows.h>
|
||||
@ -132,7 +134,6 @@ bool QtWin::enableBlurBehindWindow(QWidget *widget, bool enable)
|
||||
*/
|
||||
bool QtWin::extendFrameIntoClientArea(QWidget *widget, int left, int top, int right, int bottom)
|
||||
{
|
||||
|
||||
Q_ASSERT(widget);
|
||||
Q_UNUSED(left);
|
||||
Q_UNUSED(top);
|
||||
@ -159,10 +160,9 @@ bool QtWin::extendFrameIntoClientArea(QWidget *widget, int left, int top, int ri
|
||||
*
|
||||
* \a enable tells if the blur should be enabled or not
|
||||
*/
|
||||
QColor QtWin::colorizatinColor()
|
||||
QColor QtWin::colorizationColor()
|
||||
{
|
||||
QColor resultColor = QApplication::palette().window().color();
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
DWORD color = 0;
|
||||
BOOL opaque = FALSE;
|
||||
@ -174,7 +174,7 @@ QColor QtWin::colorizatinColor()
|
||||
return resultColor;
|
||||
}
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef W7API
|
||||
WindowNotifier *QtWin::windowNotifier()
|
||||
{
|
||||
static WindowNotifier *windowNotifierInstance = 0;
|
||||
@ -251,6 +251,15 @@ IShellLink* QtWin::CreateShellLink(const QString &title, const QString &descript
|
||||
return shell_link;
|
||||
}
|
||||
|
||||
void QtWin::populateFrequentSites(IObjectCollection* collection, const QString &appPath)
|
||||
{
|
||||
HistoryModel* historyModel = mApp->history();
|
||||
QList<HistoryModel::HistoryEntry> mostList = historyModel->mostVisited(6);
|
||||
foreach (HistoryModel::HistoryEntry entry, mostList)
|
||||
collection->AddObject(CreateShellLink(entry.title, entry.url.toString(), appPath, " "+entry.url.toEncoded(), appPath, 1));
|
||||
|
||||
collection->AddObject(CreateShellLink("", "", "", "", "", 0)); //Spacer
|
||||
}
|
||||
|
||||
void QtWin::AddTasksToList(ICustomDestinationList* destinationList) {
|
||||
IObjectArray* object_array;
|
||||
@ -264,6 +273,8 @@ void QtWin::AddTasksToList(ICustomDestinationList* destinationList) {
|
||||
QString icons_source = qApp->applicationFilePath();
|
||||
QString app_path = qApp->applicationFilePath();
|
||||
|
||||
populateFrequentSites(obj_collection, icons_source);
|
||||
|
||||
obj_collection->AddObject(CreateShellLink(tr("Open new tab"), tr("Opens a new tab if browser is running"),
|
||||
app_path, "--new-tab",
|
||||
icons_source, 0));
|
||||
@ -284,7 +295,7 @@ void QtWin::AddTasksToList(ICustomDestinationList* destinationList) {
|
||||
#endif
|
||||
|
||||
void QtWin::setupJumpList() {
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef W7API
|
||||
if (!isRunningWindows7())
|
||||
return;
|
||||
|
||||
|
6
src/3rdparty/qtwin.h
vendored
@ -56,13 +56,15 @@ public:
|
||||
int left = -1, int top = -1,
|
||||
int right = -1, int bottom = -1);
|
||||
static bool isCompositionEnabled();
|
||||
static QColor colorizatinColor();
|
||||
static QColor colorizationColor();
|
||||
|
||||
public slots:
|
||||
static void setupJumpList();
|
||||
|
||||
private:
|
||||
static WindowNotifier *windowNotifier();
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef W7API
|
||||
static void populateFrequentSites(IObjectCollection* collection, const QString &appPath);
|
||||
static void AddTasksToList(ICustomDestinationList* destinationList);
|
||||
static IShellLink* CreateShellLink(const QString &title, const QString &description, const QString &app_path, const QString &app_args, const QString &icon_path, int app_index);
|
||||
#endif
|
||||
|
@ -157,8 +157,7 @@ MainApplication::MainApplication(int &argc, char **argv)
|
||||
loadSettings();
|
||||
|
||||
QTimer::singleShot(2000, this, SLOT(restoreCursor()));
|
||||
|
||||
QtWin::setupJumpList();
|
||||
QTimer::singleShot(10*1000, this, SLOT(setupJumpList()));
|
||||
}
|
||||
|
||||
void MainApplication::loadSettings()
|
||||
@ -216,6 +215,11 @@ void MainApplication::loadSettings()
|
||||
setWheelScrollLines(scrollingLines);
|
||||
}
|
||||
|
||||
void MainApplication::setupJumpList()
|
||||
{
|
||||
QtWin::setupJumpList();
|
||||
}
|
||||
|
||||
QupZilla* MainApplication::getWindow()
|
||||
{
|
||||
for(int i=0; i<m_mainWindows.count(); i++) {
|
||||
|
@ -103,6 +103,7 @@ signals:
|
||||
void message(MainApplication::MessageType mes, bool state);
|
||||
|
||||
private slots:
|
||||
void setupJumpList();
|
||||
void restoreCursor() { QApplication::restoreOverrideCursor(); }
|
||||
|
||||
private:
|
||||
|
@ -19,7 +19,7 @@
|
||||
#define QUPZILLA_H
|
||||
|
||||
//Comment for release building
|
||||
#define DEVELOPING
|
||||
//#define DEVELOPING
|
||||
|
||||
#ifdef QT_NO_DEBUG
|
||||
#ifdef DEVELOPING
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "winver.h"
|
||||
|
||||
IDI_ICON1 ICON DISCARDABLE "icon.ico"
|
||||
IDI_ICON1 ICON DISCARDABLE "data\icons\exeicons\qupzilla.ico"
|
||||
IDI_ICON2 ICON DISCARDABLE "data\icons\exeicons\page.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,0
|
||||
|
@ -19,11 +19,13 @@
|
||||
#include "qupzilla.h"
|
||||
#include "bookmarksmodel.h"
|
||||
#include "iconprovider.h"
|
||||
#include "historymodel.h"
|
||||
|
||||
BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent) :
|
||||
QToolBar(parent)
|
||||
,p_QupZilla(mainClass)
|
||||
,m_bookmarksModel(0)
|
||||
,m_bookmarksModel(mApp->bookmarksModel())
|
||||
,m_historyModel(mApp->history())
|
||||
{
|
||||
setObjectName("bookmarksToolbar");
|
||||
setWindowTitle(tr("Bookmarks"));
|
||||
@ -31,8 +33,6 @@ BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent) :
|
||||
setMovable(false);
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
m_bookmarksModel = mApp->bookmarksModel();
|
||||
|
||||
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint)));
|
||||
|
||||
connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(addBookmark(BookmarksModel::Bookmark)));
|
||||
@ -211,15 +211,24 @@ void BookmarksToolbar::refreshMostVisited()
|
||||
{
|
||||
m_menuMostVisited->clear();
|
||||
|
||||
QSqlQuery query;
|
||||
query.exec("SELECT title, url FROM history ORDER BY count DESC LIMIT 10");
|
||||
while(query.next()) {
|
||||
QUrl url = query.value(1).toUrl();
|
||||
QString title = query.value(0).toString();
|
||||
if (title.length()>40) {
|
||||
title.truncate(40);
|
||||
title+="..";
|
||||
QList<HistoryModel::HistoryEntry> mostList = m_historyModel->mostVisited(10);
|
||||
foreach (HistoryModel::HistoryEntry entry, mostList) {
|
||||
if (entry.title.length()>40) {
|
||||
entry.title.truncate(40);
|
||||
entry.title+="..";
|
||||
}
|
||||
m_menuMostVisited->addAction(_iconForUrl(url), title, p_QupZilla, SLOT(loadActionUrl()))->setData(url);
|
||||
m_menuMostVisited->addAction(_iconForUrl(entry.url), entry.title, p_QupZilla, SLOT(loadActionUrl()))->setData(entry.url);
|
||||
}
|
||||
|
||||
// QSqlQuery query;
|
||||
// query.exec("SELECT title, url FROM history ORDER BY count DESC LIMIT 10");
|
||||
// while(query.next()) {
|
||||
// QUrl url = query.value(1).toUrl();
|
||||
// QString title = query.value(0).toString();
|
||||
// if (title.length()>40) {
|
||||
// title.truncate(40);
|
||||
// title+="..";
|
||||
// }
|
||||
// m_menuMostVisited->addAction(_iconForUrl(url), title, p_QupZilla, SLOT(loadActionUrl()))->setData(url);
|
||||
// }
|
||||
}
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
class QupZilla;
|
||||
class BookmarksModel;
|
||||
class HistoryModel;
|
||||
class BookmarksToolbar : public QToolBar
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -50,6 +51,7 @@ private slots:
|
||||
private:
|
||||
QupZilla* p_QupZilla;
|
||||
BookmarksModel* m_bookmarksModel;
|
||||
HistoryModel* m_historyModel;
|
||||
QMenu* m_menuMostVisited;
|
||||
QToolButton* m_mostVis;
|
||||
|
||||
|
BIN
src/data/icons/exeicons/page.ico
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
src/data/icons/exeicons/page16.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
src/data/icons/exeicons/page32.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
src/data/icons/exeicons/page48.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
src/data/icons/exeicons/qupzilla.ico
Normal file
After Width: | Height: | Size: 361 KiB |
BIN
src/data/icons/exeicons/qupzilla128.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/data/icons/exeicons/qupzilla16.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
src/data/icons/exeicons/qupzilla256.png
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
src/data/icons/exeicons/qupzilla32.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
src/data/icons/exeicons/qupzilla48.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
src/data/icons/exeicons/qupzilla64.png
Normal file
After Width: | Height: | Size: 10 KiB |
@ -121,6 +121,23 @@ bool HistoryModel::deleteHistoryEntry(const QString &url, const QString &title)
|
||||
return false;
|
||||
}
|
||||
|
||||
QList<HistoryModel::HistoryEntry> HistoryModel::mostVisited(int count)
|
||||
{
|
||||
QList<HistoryEntry> list;
|
||||
QSqlQuery query;
|
||||
query.exec(QString("SELECT count, date, id, title, url FROM history ORDER BY count DESC LIMIT %1").arg(count));
|
||||
while(query.next()) {
|
||||
HistoryEntry entry;
|
||||
entry.count = query.value(0).toInt();
|
||||
entry.date = query.value(1).toDateTime();
|
||||
entry.id = query.value(2).toInt();
|
||||
entry.title = query.value(3).toString();
|
||||
entry.url = query.value(4).toUrl();
|
||||
list.append(entry);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
bool HistoryModel::optimizeHistory()
|
||||
{
|
||||
QSqlQuery query;
|
||||
|
@ -45,6 +45,8 @@ public:
|
||||
bool deleteHistoryEntry(int index);
|
||||
bool deleteHistoryEntry(const QString &url, const QString &title);
|
||||
|
||||
QList<HistoryModel::HistoryEntry> mostVisited(int count);
|
||||
|
||||
bool clearHistory();
|
||||
bool optimizeHistory();
|
||||
bool isSaving();
|
||||
|
@ -638,12 +638,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>ClickToFlash</name>
|
||||
<message>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="97"/>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="95"/>
|
||||
<source>Flash blocked by ClickToFlash</source>
|
||||
<translation>Zablokováno pluginem ClickToFlash</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="99"/>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="97"/>
|
||||
<source>Add %1 to whitelist</source>
|
||||
<translation>Přidat %1 na bílou listinu</translation>
|
||||
</message>
|
||||
@ -2023,32 +2023,32 @@ nebyl nalezen!</translation>
|
||||
<context>
|
||||
<name>QtWin</name>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="323"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="267"/>
|
||||
<source>Open new tab</source>
|
||||
<translation>Otevřít nový panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="323"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="267"/>
|
||||
<source>Opens a new tab if browser is running</source>
|
||||
<translation>Otevře nový panel pokud je prohlížeč spuštěný</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="327"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="271"/>
|
||||
<source>Open new window</source>
|
||||
<translation>Otevřít nové okno</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="327"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="271"/>
|
||||
<source>Opens a new window if browser is running</source>
|
||||
<translation>Otevře nové okno pokud je prohlížeč spuštěný</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="331"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="275"/>
|
||||
<source>Open download manager</source>
|
||||
<translation>Otevřít správce stahování</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="331"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="275"/>
|
||||
<source>Opens a download manager if browser is running</source>
|
||||
<translation>Otevře správce stahování pokud je prohlížeč spuštěný</translation>
|
||||
</message>
|
||||
|
@ -642,12 +642,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>ClickToFlash</name>
|
||||
<message>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="97"/>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="95"/>
|
||||
<source>Flash blocked by ClickToFlash</source>
|
||||
<translation>Zablokované pluginom ClickToFlash</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="99"/>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="97"/>
|
||||
<source>Add %1 to whitelist</source>
|
||||
<translation>Pridať %1 na bielu listinu</translation>
|
||||
</message>
|
||||
@ -2025,32 +2025,32 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>QtWin</name>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="323"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="267"/>
|
||||
<source>Open new tab</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="323"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="267"/>
|
||||
<source>Opens a new tab if browser is running</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="327"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="271"/>
|
||||
<source>Open new window</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="327"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="271"/>
|
||||
<source>Opens a new window if browser is running</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="331"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="275"/>
|
||||
<source>Open download manager</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="331"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="275"/>
|
||||
<source>Opens a download manager if browser is running</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -1,190 +1,190 @@
|
||||
/*
|
||||
_____________________________________________________________________________
|
||||
|
||||
File Association
|
||||
_____________________________________________________________________________
|
||||
|
||||
Based on code taken from http://nsis.sourceforge.net/File_Association
|
||||
|
||||
Usage in script:
|
||||
1. !include "FileAssociation.nsh"
|
||||
2. [Section|Function]
|
||||
${FileAssociationFunction} "Param1" "Param2" "..." $var
|
||||
[SectionEnd|FunctionEnd]
|
||||
|
||||
FileAssociationFunction=[RegisterExtension|UnRegisterExtension]
|
||||
|
||||
_____________________________________________________________________________
|
||||
|
||||
${RegisterExtension} "[executable]" "[extension]" "[description]"
|
||||
|
||||
"[executable]" ; executable which opens the file format
|
||||
;
|
||||
"[extension]" ; extension, which represents the file format to open
|
||||
;
|
||||
"[description]" ; description for the extension. This will be display in Windows Explorer.
|
||||
;
|
||||
|
||||
|
||||
${UnRegisterExtension} "[extension]" "[description]"
|
||||
|
||||
"[extension]" ; extension, which represents the file format to open
|
||||
;
|
||||
"[description]" ; description for the extension. This will be display in Windows Explorer.
|
||||
;
|
||||
|
||||
_____________________________________________________________________________
|
||||
|
||||
Macros
|
||||
_____________________________________________________________________________
|
||||
|
||||
Change log window verbosity (default: 3=no script)
|
||||
|
||||
Example:
|
||||
!include "FileAssociation.nsh"
|
||||
!insertmacro RegisterExtension
|
||||
${FileAssociation_VERBOSE} 4 # all verbosity
|
||||
!insertmacro UnRegisterExtension
|
||||
${FileAssociation_VERBOSE} 3 # no script
|
||||
*/
|
||||
|
||||
|
||||
!ifndef FileAssociation_INCLUDED
|
||||
!define FileAssociation_INCLUDED
|
||||
|
||||
!include Util.nsh
|
||||
|
||||
!verbose push
|
||||
!verbose 3
|
||||
!ifndef _FileAssociation_VERBOSE
|
||||
!define _FileAssociation_VERBOSE 3
|
||||
!endif
|
||||
!verbose ${_FileAssociation_VERBOSE}
|
||||
!define FileAssociation_VERBOSE `!insertmacro FileAssociation_VERBOSE`
|
||||
!verbose pop
|
||||
|
||||
!macro FileAssociation_VERBOSE _VERBOSE
|
||||
!verbose push
|
||||
!verbose 3
|
||||
!undef _FileAssociation_VERBOSE
|
||||
!define _FileAssociation_VERBOSE ${_VERBOSE}
|
||||
!verbose pop
|
||||
!macroend
|
||||
|
||||
|
||||
|
||||
!macro RegisterExtensionCall _EXECUTABLE _EXTENSION _DESCRIPTION
|
||||
!verbose push
|
||||
!verbose ${_FileAssociation_VERBOSE}
|
||||
Push `${_DESCRIPTION}`
|
||||
Push `${_EXTENSION}`
|
||||
Push `${_EXECUTABLE}`
|
||||
${CallArtificialFunction} RegisterExtension_
|
||||
!verbose pop
|
||||
!macroend
|
||||
|
||||
!macro UnRegisterExtensionCall _EXTENSION _DESCRIPTION
|
||||
!verbose push
|
||||
!verbose ${_FileAssociation_VERBOSE}
|
||||
Push `${_EXTENSION}`
|
||||
Push `${_DESCRIPTION}`
|
||||
${CallArtificialFunction} UnRegisterExtension_
|
||||
!verbose pop
|
||||
!macroend
|
||||
|
||||
|
||||
|
||||
!define RegisterExtension `!insertmacro RegisterExtensionCall`
|
||||
!define un.RegisterExtension `!insertmacro RegisterExtensionCall`
|
||||
|
||||
!macro RegisterExtension
|
||||
!macroend
|
||||
|
||||
!macro un.RegisterExtension
|
||||
!macroend
|
||||
|
||||
!macro RegisterExtension_
|
||||
!verbose push
|
||||
!verbose ${_FileAssociation_VERBOSE}
|
||||
|
||||
Exch $R2 ;exe
|
||||
Exch
|
||||
Exch $R1 ;ext
|
||||
Exch
|
||||
Exch 2
|
||||
Exch $R0 ;desc
|
||||
Exch 2
|
||||
Push $0
|
||||
Push $1
|
||||
|
||||
ReadRegStr $1 HKCR $R1 "" ; read current file association
|
||||
StrCmp "$1" "" NoBackup ; is it empty
|
||||
StrCmp "$1" "$R0" NoBackup ; is it our own
|
||||
WriteRegStr HKCR $R1 "backup_val" "$1" ; backup current value
|
||||
NoBackup:
|
||||
WriteRegStr HKCR $R1 "" "$R0" ; set our file association
|
||||
|
||||
ReadRegStr $0 HKCR $R0 ""
|
||||
StrCmp $0 "" 0 Skip
|
||||
WriteRegStr HKCR "$R0" "" "$R0"
|
||||
WriteRegStr HKCR "$R0\shell" "" "open"
|
||||
WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0"
|
||||
Skip:
|
||||
WriteRegStr HKCR "$R0\shell\open\command" "" '"$R2" "%1"'
|
||||
WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0"
|
||||
WriteRegStr HKCR "$R0\shell\edit\command" "" '"$R2" "%1"'
|
||||
|
||||
Pop $1
|
||||
Pop $0
|
||||
Pop $R2
|
||||
Pop $R1
|
||||
Pop $R0
|
||||
|
||||
!verbose pop
|
||||
!macroend
|
||||
|
||||
|
||||
|
||||
!define UnRegisterExtension `!insertmacro UnRegisterExtensionCall`
|
||||
!define un.UnRegisterExtension `!insertmacro UnRegisterExtensionCall`
|
||||
|
||||
!macro UnRegisterExtension
|
||||
!macroend
|
||||
|
||||
!macro un.UnRegisterExtension
|
||||
!macroend
|
||||
|
||||
!macro UnRegisterExtension_
|
||||
!verbose push
|
||||
!verbose ${_FileAssociation_VERBOSE}
|
||||
|
||||
Exch $R1 ;desc
|
||||
Exch
|
||||
Exch $R0 ;ext
|
||||
Exch
|
||||
Push $0
|
||||
Push $1
|
||||
|
||||
ReadRegStr $1 HKCR $R0 ""
|
||||
StrCmp $1 $R1 0 NoOwn ; only do this if we own it
|
||||
ReadRegStr $1 HKCR $R0 "backup_val"
|
||||
StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
|
||||
DeleteRegKey HKCR $R0
|
||||
Goto NoOwn
|
||||
|
||||
Restore:
|
||||
WriteRegStr HKCR $R0 "" $1
|
||||
DeleteRegValue HKCR $R0 "backup_val"
|
||||
DeleteRegKey HKCR $R1 ;Delete key with association name settings
|
||||
|
||||
NoOwn:
|
||||
|
||||
Pop $1
|
||||
Pop $0
|
||||
Pop $R1
|
||||
Pop $R0
|
||||
|
||||
!verbose pop
|
||||
!macroend
|
||||
|
||||
!endif # !FileAssociation_INCLUDED
|
||||
/*
|
||||
_____________________________________________________________________________
|
||||
|
||||
File Association
|
||||
_____________________________________________________________________________
|
||||
|
||||
Based on code taken from http://nsis.sourceforge.net/File_Association
|
||||
|
||||
Usage in script:
|
||||
1. !include "FileAssociation.nsh"
|
||||
2. [Section|Function]
|
||||
${FileAssociationFunction} "Param1" "Param2" "..." $var
|
||||
[SectionEnd|FunctionEnd]
|
||||
|
||||
FileAssociationFunction=[RegisterExtension|UnRegisterExtension]
|
||||
|
||||
_____________________________________________________________________________
|
||||
|
||||
${RegisterExtension} "[executable]" "[extension]" "[description]"
|
||||
|
||||
"[executable]" ; executable which opens the file format
|
||||
;
|
||||
"[extension]" ; extension, which represents the file format to open
|
||||
;
|
||||
"[description]" ; description for the extension. This will be display in Windows Explorer.
|
||||
;
|
||||
|
||||
|
||||
${UnRegisterExtension} "[extension]" "[description]"
|
||||
|
||||
"[extension]" ; extension, which represents the file format to open
|
||||
;
|
||||
"[description]" ; description for the extension. This will be display in Windows Explorer.
|
||||
;
|
||||
|
||||
_____________________________________________________________________________
|
||||
|
||||
Macros
|
||||
_____________________________________________________________________________
|
||||
|
||||
Change log window verbosity (default: 3=no script)
|
||||
|
||||
Example:
|
||||
!include "FileAssociation.nsh"
|
||||
!insertmacro RegisterExtension
|
||||
${FileAssociation_VERBOSE} 4 # all verbosity
|
||||
!insertmacro UnRegisterExtension
|
||||
${FileAssociation_VERBOSE} 3 # no script
|
||||
*/
|
||||
|
||||
|
||||
!ifndef FileAssociation_INCLUDED
|
||||
!define FileAssociation_INCLUDED
|
||||
|
||||
!include Util.nsh
|
||||
|
||||
!verbose push
|
||||
!verbose 3
|
||||
!ifndef _FileAssociation_VERBOSE
|
||||
!define _FileAssociation_VERBOSE 3
|
||||
!endif
|
||||
!verbose ${_FileAssociation_VERBOSE}
|
||||
!define FileAssociation_VERBOSE `!insertmacro FileAssociation_VERBOSE`
|
||||
!verbose pop
|
||||
|
||||
!macro FileAssociation_VERBOSE _VERBOSE
|
||||
!verbose push
|
||||
!verbose 3
|
||||
!undef _FileAssociation_VERBOSE
|
||||
!define _FileAssociation_VERBOSE ${_VERBOSE}
|
||||
!verbose pop
|
||||
!macroend
|
||||
|
||||
|
||||
|
||||
!macro RegisterExtensionCall _EXECUTABLE _EXTENSION _DESCRIPTION
|
||||
!verbose push
|
||||
!verbose ${_FileAssociation_VERBOSE}
|
||||
Push `${_DESCRIPTION}`
|
||||
Push `${_EXTENSION}`
|
||||
Push `${_EXECUTABLE}`
|
||||
${CallArtificialFunction} RegisterExtension_
|
||||
!verbose pop
|
||||
!macroend
|
||||
|
||||
!macro UnRegisterExtensionCall _EXTENSION _DESCRIPTION
|
||||
!verbose push
|
||||
!verbose ${_FileAssociation_VERBOSE}
|
||||
Push `${_EXTENSION}`
|
||||
Push `${_DESCRIPTION}`
|
||||
${CallArtificialFunction} UnRegisterExtension_
|
||||
!verbose pop
|
||||
!macroend
|
||||
|
||||
|
||||
|
||||
!define RegisterExtension `!insertmacro RegisterExtensionCall`
|
||||
!define un.RegisterExtension `!insertmacro RegisterExtensionCall`
|
||||
|
||||
!macro RegisterExtension
|
||||
!macroend
|
||||
|
||||
!macro un.RegisterExtension
|
||||
!macroend
|
||||
|
||||
!macro RegisterExtension_
|
||||
!verbose push
|
||||
!verbose ${_FileAssociation_VERBOSE}
|
||||
|
||||
Exch $R2 ;exe
|
||||
Exch
|
||||
Exch $R1 ;ext
|
||||
Exch
|
||||
Exch 2
|
||||
Exch $R0 ;desc
|
||||
Exch 2
|
||||
Push $0
|
||||
Push $1
|
||||
|
||||
ReadRegStr $1 HKCR $R1 "" ; read current file association
|
||||
StrCmp "$1" "" NoBackup ; is it empty
|
||||
StrCmp "$1" "$R0" NoBackup ; is it our own
|
||||
WriteRegStr HKCR $R1 "backup_val" "$1" ; backup current value
|
||||
NoBackup:
|
||||
WriteRegStr HKCR $R1 "" "$R0" ; set our file association
|
||||
|
||||
ReadRegStr $0 HKCR $R0 ""
|
||||
StrCmp $0 "" 0 Skip
|
||||
WriteRegStr HKCR "$R0" "" "$R0"
|
||||
WriteRegStr HKCR "$R0\shell" "" "open"
|
||||
WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0"
|
||||
Skip:
|
||||
WriteRegStr HKCR "$R0\shell\open\command" "" '"$R2" "%1"'
|
||||
WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0"
|
||||
WriteRegStr HKCR "$R0\shell\edit\command" "" '"$R2" "%1"'
|
||||
|
||||
Pop $1
|
||||
Pop $0
|
||||
Pop $R2
|
||||
Pop $R1
|
||||
Pop $R0
|
||||
|
||||
!verbose pop
|
||||
!macroend
|
||||
|
||||
|
||||
|
||||
!define UnRegisterExtension `!insertmacro UnRegisterExtensionCall`
|
||||
!define un.UnRegisterExtension `!insertmacro UnRegisterExtensionCall`
|
||||
|
||||
!macro UnRegisterExtension
|
||||
!macroend
|
||||
|
||||
!macro un.UnRegisterExtension
|
||||
!macroend
|
||||
|
||||
!macro UnRegisterExtension_
|
||||
!verbose push
|
||||
!verbose ${_FileAssociation_VERBOSE}
|
||||
|
||||
Exch $R1 ;desc
|
||||
Exch
|
||||
Exch $R0 ;ext
|
||||
Exch
|
||||
Push $0
|
||||
Push $1
|
||||
|
||||
ReadRegStr $1 HKCR $R0 ""
|
||||
StrCmp $1 $R1 0 NoOwn ; only do this if we own it
|
||||
ReadRegStr $1 HKCR $R0 "backup_val"
|
||||
StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
|
||||
DeleteRegKey HKCR $R0
|
||||
Goto NoOwn
|
||||
|
||||
Restore:
|
||||
WriteRegStr HKCR $R0 "" $1
|
||||
DeleteRegValue HKCR $R0 "backup_val"
|
||||
DeleteRegKey HKCR $R1 ;Delete key with association name settings
|
||||
|
||||
NoOwn:
|
||||
|
||||
Pop $1
|
||||
Pop $0
|
||||
Pop $R1
|
||||
Pop $R0
|
||||
|
||||
!verbose pop
|
||||
!macroend
|
||||
|
||||
!endif # !FileAssociation_INCLUDED
|
||||
|
@ -1,216 +1,216 @@
|
||||
RequestExecutionLevel user
|
||||
!include "FileAssociation.nsh"
|
||||
SetCompressor /SOLID /FINAL lzma
|
||||
|
||||
!define PRODUCT_NAME "QupZilla"
|
||||
!define /date PRODUCT_VERSION "0.9.9"
|
||||
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\qupzilla.exe"
|
||||
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
||||
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
||||
|
||||
!include "MUI.nsh"
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_ICON "wininstall\install.ico"
|
||||
!define MUI_UNICON "wininstall\uninstall.ico"
|
||||
!define MUI_WELCOMEFINISHPAGE_BITMAP "wininstall\welcome.bmp"
|
||||
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "wininstall\welcome.bmp"
|
||||
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_LICENSE COPYRIGHT.txt
|
||||
!insertmacro MUI_PAGE_COMPONENTS
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR\qupzilla.exe"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
!insertmacro MUI_UNPAGE_WELCOME
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
!insertmacro MUI_UNPAGE_FINISH
|
||||
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
!insertmacro MUI_LANGUAGE "Czech"
|
||||
!insertmacro MUI_LANGUAGE "Slovak"
|
||||
!insertmacro MUI_LANGUAGE "Dutch"
|
||||
!insertmacro MUI_LANGUAGE "French"
|
||||
!insertmacro MUI_LANGUAGE "German"
|
||||
!insertmacro MUI_LANGUAGE "Korean"
|
||||
!insertmacro MUI_LANGUAGE "Russian"
|
||||
!insertmacro MUI_LANGUAGE "Spanish"
|
||||
!insertmacro MUI_LANGUAGE "Swedish"
|
||||
!insertmacro MUI_LANGUAGE "Tradchinese"
|
||||
!insertmacro MUI_LANGUAGE "Simpchinese"
|
||||
|
||||
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||
|
||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
||||
OutFile "${PRODUCT_NAME} ${PRODUCT_VERSION} Installer.exe"
|
||||
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}\"
|
||||
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
|
||||
ShowInstDetails show
|
||||
ShowUnInstDetails show
|
||||
|
||||
!include "wininstall\languages.nsh"
|
||||
|
||||
Section !$(TITLE_SecMain) SecMain
|
||||
SectionIn RO
|
||||
KillProcDLL::KillProc "qupzilla.exe"
|
||||
Sleep 100
|
||||
SetOverwrite on
|
||||
|
||||
SetOutPath "$INSTDIR"
|
||||
File "COPYRIGHT.txt"
|
||||
File "qupzilla.exe"
|
||||
File "libeay32.dll"
|
||||
File "ssleay32.dll"
|
||||
File "msvcp90.dll"
|
||||
File "msvcr90.dll"
|
||||
File "phonon4.dll"
|
||||
File "QtCore4.dll"
|
||||
File "QtGui4.dll"
|
||||
File "QtNetwork4.dll"
|
||||
File "QtSql4.dll"
|
||||
File "QtWebKit4.dll"
|
||||
|
||||
SetOutPath "$INSTDIR\data\default\profiles"
|
||||
File "data\default\profiles\profiles.ini"
|
||||
|
||||
SetOutPath "$INSTDIR\data\default\profiles\default"
|
||||
File "data\default\profiles\default\background.png"
|
||||
File "data\default\profiles\default\browsedata.db"
|
||||
|
||||
SetOutPath "$INSTDIR\imageformats"
|
||||
File "imageformats\qico4.dll"
|
||||
File "imageformats\qsvg4.dll"
|
||||
File "imageformats\qgif4.dll"
|
||||
File "imageformats\qjpeg4.dll"
|
||||
File "imageformats\qtiff4.dll"
|
||||
File "imageformats\qmng4.dll"
|
||||
|
||||
SetOutPath "$INSTDIR\sqldrivers"
|
||||
File "sqldrivers\qsqlite4.dll"
|
||||
File "sqldrivers\qsqlodbc4.dll"
|
||||
|
||||
SectionEnd
|
||||
|
||||
SectionGroup $(TITLE_SecTranslations) SecTranslations
|
||||
Section $(TITLE_SecEnglish) SecEnglish
|
||||
SectionIn RO
|
||||
SectionEnd
|
||||
|
||||
Section $(TITLE_SecCzech) SecCzech
|
||||
SetOutPath "$INSTDIR\locale"
|
||||
File "locale\cs_CZ.qm"
|
||||
File "locale\qt_cs.qm"
|
||||
SectionEnd
|
||||
|
||||
Section $(TITLE_SecSlovak) SecSlovak
|
||||
SetOutPath "$INSTDIR\locale"
|
||||
File "locale\sk_SK.qm"
|
||||
File "locale\qt_sk.qm"
|
||||
SectionEnd
|
||||
|
||||
SectionGroupEnd
|
||||
|
||||
SectionGroup $(TITLE_SecPlugins) SecPlugins
|
||||
Section $(TITLE_SecExamplePlugin) SecExamplePlugin
|
||||
SetOutPath "$INSTDIR\plugins"
|
||||
File "plugins\ExamplePlugin.dll"
|
||||
SectionEnd
|
||||
SectionGroupEnd
|
||||
|
||||
|
||||
Section $(TITLE_SecExtensions) SecExtensions
|
||||
SetOutPath "$INSTDIR"
|
||||
${registerExtension} "$INSTDIR\qupzilla.exe" ".htm" "HTM File"
|
||||
${registerExtension} "$INSTDIR\qupzilla.exe" ".html" "HTML File"
|
||||
SectionEnd
|
||||
|
||||
Section "-StartMenu"
|
||||
SetOutPath "$INSTDIR"
|
||||
SetShellVarContext all
|
||||
CreateDirectory "$SMPROGRAMS\QupZilla"
|
||||
CreateShortCut "$SMPROGRAMS\QupZilla\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
||||
CreateShortCut "$SMPROGRAMS\QupZilla\QupZilla.lnk" "$INSTDIR\qupzilla.exe"
|
||||
CreateShortCut "$SMPROGRAMS\QupZilla\License.lnk" "$INSTDIR\COPYRIGHT.txt"
|
||||
SectionEnd
|
||||
|
||||
Section $(TITLE_SecDesktop) SecDesktop
|
||||
SetOutPath "$INSTDIR"
|
||||
CreateShortCut "$DESKTOP\QupZilla.lnk" "$INSTDIR\qupzilla.exe" ""
|
||||
SectionEnd
|
||||
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecMain} $(DESC_SecMain)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecTranslations} $(DESC_SecTranslations)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecEnglish} $(DESC_SecEnglish)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecCzech} $(DESC_SecCzech)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecSlovak} $(DESC_SecSlovak)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} $(DESC_SecPlugins)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecExamplePlugin} $(DESC_SecExamplePlugin)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} $(DESC_SecDesktop)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecExtensions} $(DESC_SecExtensions)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
||||
Section "-Uninstaller"
|
||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\qupzilla.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\Uninstall.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\qupzilla.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
||||
SectionEnd
|
||||
|
||||
Section Uninstall
|
||||
KillProcDLL::KillProc "qupzilla.exe"
|
||||
Sleep 100
|
||||
|
||||
SetShellVarContext all
|
||||
Delete "$DESKTOP\QupZilla.lnk"
|
||||
RMDir /r "$INSTDIR"
|
||||
RMDir /r "$SMPROGRAMS\QupZilla"
|
||||
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
|
||||
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
|
||||
${unregisterExtension} ".htm" $(FILE_Htm)
|
||||
${unregisterExtension} ".html" $(FILE_Html)
|
||||
SectionEnd
|
||||
|
||||
BrandingText "${PRODUCT_NAME} ${PRODUCT_VERSION} Installer"
|
||||
|
||||
Function .onInit
|
||||
;Language selection dialog
|
||||
|
||||
Push ""
|
||||
Push ${LANG_ENGLISH}
|
||||
Push English
|
||||
Push ${LANG_CZECH}
|
||||
Push Czech
|
||||
Push ${LANG_DUTCH}
|
||||
Push Dutch
|
||||
Push ${LANG_FRENCH}
|
||||
Push French
|
||||
Push ${LANG_GERMAN}
|
||||
Push German
|
||||
Push ${LANG_KOREAN}
|
||||
Push Korean
|
||||
Push ${LANG_RUSSIAN}
|
||||
Push Russian
|
||||
Push ${LANG_SPANISH}
|
||||
Push Spanish
|
||||
Push ${LANG_SWEDISH}
|
||||
Push Swedish
|
||||
Push ${LANG_TRADCHINESE}
|
||||
Push "Traditional Chinese"
|
||||
Push ${LANG_SIMPCHINESE}
|
||||
Push "Simplified Chinese"
|
||||
Push ${LANG_SLOVAK}
|
||||
Push Slovak
|
||||
Push A ; A means auto count languages
|
||||
; for the auto count to work the first empty push (Push "") must remain
|
||||
LangDLL::LangDialog "Installer Language" "Please select the language of the installer"
|
||||
|
||||
Pop $LANGUAGE
|
||||
StrCmp $LANGUAGE "cancel" 0 +2
|
||||
Abort
|
||||
FunctionEnd
|
||||
RequestExecutionLevel admin
|
||||
!include "FileAssociation.nsh"
|
||||
SetCompressor /SOLID /FINAL lzma
|
||||
|
||||
!define PRODUCT_NAME "QupZilla"
|
||||
!define /date PRODUCT_VERSION "0.9.9"
|
||||
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\qupzilla.exe"
|
||||
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
||||
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
||||
|
||||
!include "MUI.nsh"
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_ICON "wininstall\install.ico"
|
||||
!define MUI_UNICON "wininstall\uninstall.ico"
|
||||
!define MUI_WELCOMEFINISHPAGE_BITMAP "wininstall\welcome.bmp"
|
||||
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "wininstall\welcome.bmp"
|
||||
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_LICENSE COPYRIGHT.txt
|
||||
!insertmacro MUI_PAGE_COMPONENTS
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR\qupzilla.exe"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
!insertmacro MUI_UNPAGE_WELCOME
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
!insertmacro MUI_UNPAGE_FINISH
|
||||
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
!insertmacro MUI_LANGUAGE "Czech"
|
||||
!insertmacro MUI_LANGUAGE "Slovak"
|
||||
!insertmacro MUI_LANGUAGE "Dutch"
|
||||
!insertmacro MUI_LANGUAGE "French"
|
||||
!insertmacro MUI_LANGUAGE "German"
|
||||
!insertmacro MUI_LANGUAGE "Korean"
|
||||
!insertmacro MUI_LANGUAGE "Russian"
|
||||
!insertmacro MUI_LANGUAGE "Spanish"
|
||||
!insertmacro MUI_LANGUAGE "Swedish"
|
||||
!insertmacro MUI_LANGUAGE "Tradchinese"
|
||||
!insertmacro MUI_LANGUAGE "Simpchinese"
|
||||
|
||||
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||
|
||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
||||
OutFile "${PRODUCT_NAME} ${PRODUCT_VERSION} Installer.exe"
|
||||
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}\"
|
||||
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
|
||||
ShowInstDetails show
|
||||
ShowUnInstDetails show
|
||||
|
||||
!include "wininstall\languages.nsh"
|
||||
|
||||
Section !$(TITLE_SecMain) SecMain
|
||||
SectionIn RO
|
||||
KillProcDLL::KillProc "qupzilla.exe"
|
||||
Sleep 100
|
||||
SetOverwrite on
|
||||
|
||||
SetOutPath "$INSTDIR"
|
||||
File "COPYRIGHT.txt"
|
||||
File "qupzilla.exe"
|
||||
File "libeay32.dll"
|
||||
File "ssleay32.dll"
|
||||
File "msvcp90.dll"
|
||||
File "msvcr90.dll"
|
||||
File "phonon4.dll"
|
||||
File "QtCore4.dll"
|
||||
File "QtGui4.dll"
|
||||
File "QtNetwork4.dll"
|
||||
File "QtSql4.dll"
|
||||
File "QtWebKit4.dll"
|
||||
|
||||
SetOutPath "$INSTDIR\data\default\profiles"
|
||||
File "data\default\profiles\profiles.ini"
|
||||
|
||||
SetOutPath "$INSTDIR\data\default\profiles\default"
|
||||
File "data\default\profiles\default\background.png"
|
||||
File "data\default\profiles\default\browsedata.db"
|
||||
|
||||
SetOutPath "$INSTDIR\imageformats"
|
||||
File "imageformats\qico4.dll"
|
||||
File "imageformats\qsvg4.dll"
|
||||
File "imageformats\qgif4.dll"
|
||||
File "imageformats\qjpeg4.dll"
|
||||
File "imageformats\qtiff4.dll"
|
||||
File "imageformats\qmng4.dll"
|
||||
|
||||
SetOutPath "$INSTDIR\sqldrivers"
|
||||
File "sqldrivers\qsqlite4.dll"
|
||||
File "sqldrivers\qsqlodbc4.dll"
|
||||
|
||||
SectionEnd
|
||||
|
||||
SectionGroup $(TITLE_SecTranslations) SecTranslations
|
||||
Section $(TITLE_SecEnglish) SecEnglish
|
||||
SectionIn RO
|
||||
SectionEnd
|
||||
|
||||
Section $(TITLE_SecCzech) SecCzech
|
||||
SetOutPath "$INSTDIR\locale"
|
||||
File "locale\cs_CZ.qm"
|
||||
File "locale\qt_cs.qm"
|
||||
SectionEnd
|
||||
|
||||
Section $(TITLE_SecSlovak) SecSlovak
|
||||
SetOutPath "$INSTDIR\locale"
|
||||
File "locale\sk_SK.qm"
|
||||
File "locale\qt_sk.qm"
|
||||
SectionEnd
|
||||
|
||||
SectionGroupEnd
|
||||
|
||||
SectionGroup $(TITLE_SecPlugins) SecPlugins
|
||||
Section $(TITLE_SecExamplePlugin) SecExamplePlugin
|
||||
SetOutPath "$INSTDIR\plugins"
|
||||
File "plugins\ExamplePlugin.dll"
|
||||
SectionEnd
|
||||
SectionGroupEnd
|
||||
|
||||
|
||||
Section $(TITLE_SecExtensions) SecExtensions
|
||||
SetOutPath "$INSTDIR"
|
||||
${registerExtension} "$INSTDIR\qupzilla.exe" ".htm" "HTM File"
|
||||
${registerExtension} "$INSTDIR\qupzilla.exe" ".html" "HTML File"
|
||||
SectionEnd
|
||||
|
||||
Section "-StartMenu"
|
||||
SetOutPath "$INSTDIR"
|
||||
SetShellVarContext all
|
||||
CreateDirectory "$SMPROGRAMS\QupZilla"
|
||||
CreateShortCut "$SMPROGRAMS\QupZilla\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
||||
CreateShortCut "$SMPROGRAMS\QupZilla\QupZilla.lnk" "$INSTDIR\qupzilla.exe"
|
||||
CreateShortCut "$SMPROGRAMS\QupZilla\License.lnk" "$INSTDIR\COPYRIGHT.txt"
|
||||
SectionEnd
|
||||
|
||||
Section $(TITLE_SecDesktop) SecDesktop
|
||||
SetOutPath "$INSTDIR"
|
||||
CreateShortCut "$DESKTOP\QupZilla.lnk" "$INSTDIR\qupzilla.exe" ""
|
||||
SectionEnd
|
||||
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecMain} $(DESC_SecMain)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecTranslations} $(DESC_SecTranslations)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecEnglish} $(DESC_SecEnglish)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecCzech} $(DESC_SecCzech)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecSlovak} $(DESC_SecSlovak)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} $(DESC_SecPlugins)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecExamplePlugin} $(DESC_SecExamplePlugin)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} $(DESC_SecDesktop)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecExtensions} $(DESC_SecExtensions)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
||||
Section "-Uninstaller"
|
||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\qupzilla.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\Uninstall.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\qupzilla.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
||||
SectionEnd
|
||||
|
||||
Section Uninstall
|
||||
KillProcDLL::KillProc "qupzilla.exe"
|
||||
Sleep 100
|
||||
|
||||
SetShellVarContext all
|
||||
Delete "$DESKTOP\QupZilla.lnk"
|
||||
RMDir /r "$INSTDIR"
|
||||
RMDir /r "$SMPROGRAMS\QupZilla"
|
||||
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
|
||||
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
|
||||
${unregisterExtension} ".htm" $(FILE_Htm)
|
||||
${unregisterExtension} ".html" $(FILE_Html)
|
||||
SectionEnd
|
||||
|
||||
BrandingText "${PRODUCT_NAME} ${PRODUCT_VERSION} Installer"
|
||||
|
||||
Function .onInit
|
||||
;Language selection dialog
|
||||
|
||||
Push ""
|
||||
Push ${LANG_ENGLISH}
|
||||
Push English
|
||||
Push ${LANG_CZECH}
|
||||
Push Czech
|
||||
Push ${LANG_DUTCH}
|
||||
Push Dutch
|
||||
Push ${LANG_FRENCH}
|
||||
Push French
|
||||
Push ${LANG_GERMAN}
|
||||
Push German
|
||||
Push ${LANG_KOREAN}
|
||||
Push Korean
|
||||
Push ${LANG_RUSSIAN}
|
||||
Push Russian
|
||||
Push ${LANG_SPANISH}
|
||||
Push Spanish
|
||||
Push ${LANG_SWEDISH}
|
||||
Push Swedish
|
||||
Push ${LANG_TRADCHINESE}
|
||||
Push "Traditional Chinese"
|
||||
Push ${LANG_SIMPCHINESE}
|
||||
Push "Simplified Chinese"
|
||||
Push ${LANG_SLOVAK}
|
||||
Push Slovak
|
||||
Push A ; A means auto count languages
|
||||
; for the auto count to work the first empty push (Push "") must remain
|
||||
LangDLL::LangDialog "Installer Language" "Please select the language of the installer"
|
||||
|
||||
Pop $LANGUAGE
|
||||
StrCmp $LANGUAGE "cancel" 0 +2
|
||||
Abort
|
||||
FunctionEnd
|
||||
|