Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows auto-update #1453

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bitcoin-qt.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ VERSION = 0.6.99
INCLUDEPATH += src src/json src/qt
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE USE_IPV6
CONFIG += no_include_pwd
QT += network

# for boost 1.37, add -mt to the boost libraries
# use: qmake BOOST_LIB_SUFFIX=-mt
Expand Down Expand Up @@ -102,6 +103,7 @@ HEADERS += src/qt/bitcoingui.h \
src/qt/addressbookpage.h \
src/qt/messagepage.h \
src/qt/aboutdialog.h \
src/qt/updatedialog.h \
src/qt/editaddressdialog.h \
src/qt/bitcoinaddressvalidator.h \
src/addrman.h \
Expand Down Expand Up @@ -171,6 +173,7 @@ SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \
src/qt/addressbookpage.cpp \
src/qt/messagepage.cpp \
src/qt/aboutdialog.cpp \
src/qt/updatedialog.cpp \
src/qt/editaddressdialog.cpp \
src/qt/bitcoinaddressvalidator.cpp \
src/version.cpp \
Expand Down Expand Up @@ -230,6 +233,7 @@ FORMS += \
src/qt/forms/addressbookpage.ui \
src/qt/forms/messagepage.ui \
src/qt/forms/aboutdialog.ui \
src/qt/forms/updatedialog.ui \
src/qt/forms/editaddressdialog.ui \
src/qt/forms/transactiondescdialog.ui \
src/qt/forms/overviewpage.ui \
Expand Down
3 changes: 3 additions & 0 deletions contrib/gitian-descriptors/gitian-win32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ files:
- "qt-win32-4.7.4-gitian.zip"
- "boost-win32-1.47.0-gitian.zip"
- "bitcoin-deps-0.0.4.zip"
- "gitian-updater-0.1.zip"
script: |
#
mkdir $HOME/qt
Expand All @@ -43,6 +44,8 @@ script: |
#
find -type f | xargs touch --date="$REFERENCE_DATETIME"
#
unzip gitian-updater-0.1.zip
#
cd bitcoin
mkdir -p $OUTDIR/src
git archive HEAD | tar -x -C $OUTDIR/src
Expand Down
5 changes: 1 addition & 4 deletions contrib/gitian-downloader/win32-download-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
name: bitcoin
urls:
- http://bitcoin.org/bitcoin-latest-win32-gitian.zip
rss:
- url: http://sourceforge.net/api/file/index/project-id/244765/mtime/desc/limit/100/rss
xpath: //item/link/text()
pattern: bitcoin-\d+.\d+.\d+-win32-gitian.zip
- http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-latest-win32-gitian.zip/download
signers:
0A82509767C7D4A5D14DA2301AE1D35043E08E54:
weight: 40
Expand Down
2 changes: 2 additions & 0 deletions doc/release-process.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
bitcoin-qt.pro
src/version.h
share/setup.nsi
share/update_reg.reg (save with Windows line-endings)
doc/README*

* tag version in git
Expand Down Expand Up @@ -94,6 +95,7 @@

* update bitcoin.org version
make sure all OS download links go to the right versions
include bitcoin.org/latestversion.txt

* update forum version

Expand Down
27 changes: 16 additions & 11 deletions share/setup.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,29 @@ ShowUninstDetails show

# Installer sections
Section -Main SEC0000
SetOutPath $INSTDIR
SetOutPath $INSTDIR\Bitcoin
SetOverwrite on
File ../release/bitcoin-qt.exe
File /oname=license.txt ../COPYING
File /oname=readme.txt ../doc/README_windows.txt
SetOutPath $INSTDIR\daemon
SetOutPath $INSTDIR\Bitcoin\daemon
File ../src/bitcoind.exe
SetOutPath $INSTDIR\src
SetOutPath $INSTDIR\Bitcoin\src
File /r /x *.exe /x *.o ../src\*.*
SetOutPath $INSTDIR
File /r ../../gitian-updater
WriteRegStr HKCU "${REGKEY}\Components" Main 1

# Remove old wxwidgets-based-bitcoin executable and locales:
Delete /REBOOTOK $INSTDIR\bitcoin.exe
RMDir /r /REBOOTOK $INSTDIR\locale

# Remove Bitcoin-Qt installed in $INSTDIR instead of $INSTDIR/Bitcoin
Delete /REBOOTOK $INSTDIR\bitcoin-qt.exe
Delete /REBOOTOK $INSTDIR\readme.txt
Delete /REBOOTOK $INSTDIR\license.txt
RMDir /r /REBOOTOK $INSTDIR\daemon
RMDir /r /REBOOTOK $INSTDIR\src
SectionEnd

Section -post SEC0001
Expand All @@ -87,7 +95,7 @@ Section -post SEC0001
WriteUninstaller $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory $SMPROGRAMS\$StartMenuGroup
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk" $INSTDIR\bitcoin-qt.exe
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk" $INSTDIR\Bitcoin\bitcoin-qt.exe
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk" $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
Expand All @@ -102,8 +110,8 @@ Section -post SEC0001
# bitcoin: URI handling disabled for 0.6.0
# WriteRegStr HKCR "bitcoin" "URL Protocol" ""
# WriteRegStr HKCR "bitcoin" "" "URL:Bitcoin"
# WriteRegStr HKCR "bitcoin\DefaultIcon" "" $INSTDIR\bitcoin-qt.exe
# WriteRegStr HKCR "bitcoin\shell\open\command" "" '"$INSTDIR\bitcoin-qt.exe" "$$1"'
# WriteRegStr HKCR "bitcoin\DefaultIcon" "" $INSTDIR\Bitcoin\bitcoin-qt.exe
# WriteRegStr HKCR "bitcoin\shell\open\command" "" '"$INSTDIR\Bitcoin\bitcoin-qt.exe" "$$1"'
SectionEnd

# Macro for selecting uninstaller sections
Expand All @@ -121,11 +129,8 @@ done${UNSECTION_ID}:

# Uninstaller sections
Section /o -un.Main UNSEC0000
Delete /REBOOTOK $INSTDIR\bitcoin-qt.exe
Delete /REBOOTOK $INSTDIR\license.txt
Delete /REBOOTOK $INSTDIR\readme.txt
RMDir /r /REBOOTOK $INSTDIR\daemon
RMDir /r /REBOOTOK $INSTDIR\src
RMDir /r /REBOOTOK $INSTDIR\Bitcoin
RMDir /r /REBOOTOK $INSTDIR\gitian-updater
DeleteRegValue HKCU "${REGKEY}\Components" Main
SectionEnd

Expand Down
6 changes: 6 additions & 0 deletions share/update_reg.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Bitcoin]
"DisplayVersion"="0.6.99"


8 changes: 8 additions & 0 deletions src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,14 @@ bool GetProxy(enum Network net, CService &addrProxy) {
return true;
}

bool GetProxySocksVersion(enum Network net, int &nSocksVersion) {
assert(net >= 0 && net < NET_MAX);
if (!proxyInfo[net].second)
return false;
nSocksVersion = proxyInfo[net].second;
return true;
}

bool SetNameProxy(CService addrProxy, int nSocksVersion) {
if (nSocksVersion != 0 && nSocksVersion != 5)
return false;
Expand Down
1 change: 1 addition & 0 deletions src/netbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ enum Network ParseNetwork(std::string net);
void SplitHostPort(std::string in, int &portOut, std::string &hostOut);
bool SetProxy(enum Network net, CService addrProxy, int nSocksVersion = 5);
bool GetProxy(enum Network net, CService &addrProxy);
bool GetProxySocksVersion(enum Network net, int &nSocksVersion);
bool IsProxy(const CNetAddr &addr);
bool SetNameProxy(CService addrProxy, int nSocksVersion = 5);
bool GetNameProxy();
Expand Down
6 changes: 6 additions & 0 deletions src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "optionsmodel.h"
#include "guiutil.h"
#include "guiconstants.h"
#include "updatedialog.h"

#include "init.h"
#include "ui_interface.h"
Expand Down Expand Up @@ -283,6 +284,11 @@ int main(int argc, char *argv[])
}
}
#endif

#ifdef WIN32
UpdateDialog* dlg = new UpdateDialog(clientModel);
#endif

app.exec();

window.hide();
Expand Down
6 changes: 6 additions & 0 deletions src/qt/clientmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "addresstablemodel.h"
#include "transactiontablemodel.h"

#include "version.h"
#include "main.h"
#include "ui_interface.h"

Expand Down Expand Up @@ -115,6 +116,11 @@ OptionsModel *ClientModel::getOptionsModel()
return optionsModel;
}

int ClientModel::clientVersion() const
{
return CLIENT_VERSION;
}

QString ClientModel::formatFullVersion() const
{
return QString::fromStdString(FormatFullVersion());
Expand Down
1 change: 1 addition & 0 deletions src/qt/clientmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class ClientModel : public QObject
//! Return warnings to be displayed in status bar
QString getStatusBarWarnings() const;

int clientVersion() const;
QString formatFullVersion() const;
QString formatBuildDate() const;
QString clientName() const;
Expand Down
Loading