2012-10-12 16:37:12 +00:00
#!/usr/bin/env python
#coding:utf8
2015-01-26 00:47:11 +00:00
''' *** TROUBLESHOOTING ***
1 ) If you get the error " ImportError: No module named zope.interface " then add an empty __init__ . py file to the PYTHONDIR / Lib / site - packages / zope directory
2 ) It is expected that you will have Unicode NSIS from http : / / www . scratchpaper . com / installed to : C : \Program Files ( x86 ) \NSIS \Unicode \
'''
2014-08-03 20:06:40 +00:00
import sys
try :
if ( sys . version_info . major != 2 ) or ( sys . version_info . minor < 7 ) :
raise Exception ( " You must build Syncplay with Python 2.7! " )
except AttributeError :
import warnings
warnings . warn ( " You must build Syncplay with Python 2.7! " )
2012-12-30 13:07:07 +00:00
from distutils . core import setup
from py2exe . build_exe import py2exe
2013-01-15 18:27:21 +00:00
from string import Template
2012-10-12 16:37:12 +00:00
import syncplay
2013-01-15 18:27:21 +00:00
import os
import subprocess
2012-10-12 16:37:12 +00:00
2014-11-30 17:58:03 +00:00
from syncplay . messages import getMissingStrings
missingStrings = getMissingStrings ( )
if missingStrings is not None and missingStrings is not " " :
import warnings
warnings . warn ( " MISSING/UNUSED STRINGS DETECTED: \n {} " . format ( missingStrings ) )
2014-11-29 13:56:26 +00:00
p = " C: \\ Program Files (x86) \\ NSIS \\ Unicode \\ makensis.exe " #TODO: how to move that into proper place, huh
2013-01-16 14:00:57 +00:00
NSIS_COMPILE = p if os . path . isfile ( p ) else " makensis.exe "
OUT_DIR = " syncplay v {} " . format ( syncplay . version )
2013-01-15 18:27:21 +00:00
SETUP_SCRIPT_PATH = " syncplay_setup.nsi "
NSIS_SCRIPT_TEMPLATE = r """
! include LogicLib . nsh
! include nsDialogs . nsh
2013-01-26 21:10:28 +00:00
! include FileFunc . nsh
2013-01-16 14:00:57 +00:00
2013-01-15 18:27:21 +00:00
LoadLanguageFile " $$ {NSISDIR} \ Contrib \ Language files \ English.nlf "
LoadLanguageFile " $$ {NSISDIR} \ Contrib \ Language files \ Polish.nlf "
2014-10-14 11:56:08 +00:00
LoadLanguageFile " $$ {NSISDIR} \ Contrib \ Language files \ Russian.nlf "
2014-11-29 15:01:45 +00:00
LoadLanguageFile " $$ {NSISDIR} \ Contrib \ Language files \ German.nlf "
2014-11-29 13:56:26 +00:00
2013-01-26 20:37:51 +00:00
Name " Syncplay $version "
OutFile " Syncplay $version Setup.exe "
2013-01-15 18:27:21 +00:00
InstallDir $ $ PROGRAMFILES \Syncplay
RequestExecutionLevel admin
XPStyle on
Icon resources \icon . ico ; Change DIR
SetCompressor / SOLID lzma
2014-11-29 13:56:26 +00:00
2013-01-16 14:00:57 +00:00
VIProductVersion " $version.0 "
2013-01-15 18:27:21 +00:00
VIAddVersionKey / LANG = $ $ { LANG_ENGLISH } " ProductName " " Syncplay "
2013-01-16 14:00:57 +00:00
VIAddVersionKey / LANG = $ $ { LANG_ENGLISH } " FileVersion " " $version.0 "
2013-01-15 18:27:21 +00:00
VIAddVersionKey / LANG = $ $ { LANG_ENGLISH } " LegalCopyright " " Syncplay "
VIAddVersionKey / LANG = $ $ { LANG_ENGLISH } " FileDescription " " Syncplay "
2014-11-29 13:56:26 +00:00
2013-01-15 18:27:21 +00:00
VIAddVersionKey / LANG = $ $ { LANG_POLISH } " ProductName " " Syncplay "
2013-01-16 14:00:57 +00:00
VIAddVersionKey / LANG = $ $ { LANG_POLISH } " FileVersion " " $version.0 "
2013-01-15 18:27:21 +00:00
VIAddVersionKey / LANG = $ $ { LANG_POLISH } " LegalCopyright " " Syncplay "
2013-01-29 12:30:40 +00:00
VIAddVersionKey / LANG = $ $ { LANG_POLISH } " FileDescription " " Syncplay "
2014-11-29 13:56:26 +00:00
2014-10-14 11:56:08 +00:00
VIAddVersionKey / LANG = $ $ { LANG_RUSSIAN } " ProductName " " Syncplay "
VIAddVersionKey / LANG = $ $ { LANG_RUSSIAN } " FileVersion " " $version.0 "
VIAddVersionKey / LANG = $ $ { LANG_RUSSIAN } " LegalCopyright " " Syncplay "
VIAddVersionKey / LANG = $ $ { LANG_RUSSIAN } " FileDescription " " Syncplay "
2014-11-29 13:56:26 +00:00
2014-06-29 19:56:18 +00:00
LangString ^ SyncplayLanguage $ $ { LANG_ENGLISH } " en "
2013-01-29 12:30:40 +00:00
LangString ^ Associate $ $ { LANG_ENGLISH } " Associate Syncplay with multimedia files. "
2014-06-29 17:18:38 +00:00
LangString ^ VLC $ $ { LANG_ENGLISH } " Install Syncplay interface for VLC 2 and above "
LangString ^ BrowseVLCBtn $ $ { LANG_ENGLISH } " Select VLC folder "
2013-01-29 12:30:40 +00:00
LangString ^ Shortcut $ $ { LANG_ENGLISH } " Create Shortcuts in following locations: "
LangString ^ StartMenu $ $ { LANG_ENGLISH } " Start Menu "
LangString ^ Desktop $ $ { LANG_ENGLISH } " Desktop "
LangString ^ QuickLaunchBar $ $ { LANG_ENGLISH } " Quick Launch Bar "
2015-01-03 13:58:18 +00:00
LangString ^ AutomaticUpdates $ $ { LANG_ENGLISH } " Check for updates automatically "
2013-01-29 14:15:40 +00:00
LangString ^ UninstConfig $ $ { LANG_ENGLISH } " Delete configuration file. "
2014-11-29 13:56:26 +00:00
2014-06-29 19:56:18 +00:00
LangString ^ SyncplayLanguage $ $ { LANG_POLISH } " pl "
2013-01-29 12:30:40 +00:00
LangString ^ Associate $ $ { LANG_POLISH } " Skojarz Syncplaya z multimediami "
2014-06-29 17:18:38 +00:00
LangString ^ VLC $ $ { LANG_POLISH } " Zainstaluj interface Syncplaya dla VLC 2+ "
LangString ^ BrowseVLCBtn $ $ { LANG_POLISH } " Określ folder VLC "
2013-01-29 12:30:40 +00:00
LangString ^ Shortcut $ $ { LANG_POLISH } " Utworz skroty w nastepujacych miejscach: "
LangString ^ StartMenu $ $ { LANG_POLISH } " Menu Start "
LangString ^ Desktop $ $ { LANG_POLISH } " Pulpit "
LangString ^ QuickLaunchBar $ $ { LANG_POLISH } " Pasek szybkiego uruchamiania "
2013-01-29 14:15:40 +00:00
LangString ^ UninstConfig $ $ { LANG_POLISH } " Usun plik konfiguracyjny. "
2014-11-29 13:56:26 +00:00
2014-10-14 11:56:08 +00:00
LangString ^ SyncplayLanguage $ $ { LANG_RUSSIAN } " ru "
LangString ^ Associate $ $ { LANG_RUSSIAN } " Ассоциировать Syncplay с видеофайлами "
LangString ^ VLC $ $ { LANG_RUSSIAN } " Установить интерфейс Syncplay для VLC 2+ "
LangString ^ BrowseVLCBtn $ $ { LANG_RUSSIAN } " Укажите папку VLC "
LangString ^ Shortcut $ $ { LANG_RUSSIAN } " Создать ярлыки: "
LangString ^ StartMenu $ $ { LANG_RUSSIAN } " в меню Пуск "
LangString ^ Desktop $ $ { LANG_RUSSIAN } " на рабочем столе "
LangString ^ QuickLaunchBar $ $ { LANG_RUSSIAN } " в меню быстрого запуска "
2015-01-03 13:58:18 +00:00
LangString ^ AutomaticUpdates $ $ { LANG_RUSSIAN } " Проверять обновления автоматически " ; TODO : Confirm Russian translation ( " Check for updates automatically " )
2014-10-14 11:56:08 +00:00
LangString ^ UninstConfig $ $ { LANG_RUSSIAN } " Удалить файл настроек. "
2014-11-29 13:56:26 +00:00
2014-11-29 15:01:45 +00:00
LangString ^ SyncplayLanguage $ $ { LANG_GERMAN } " de "
LangString ^ Associate $ $ { LANG_GERMAN } " Syncplay mit Multimedia-Dateien assoziieren. "
2014-11-29 15:54:57 +00:00
LangString ^ VLC $ $ { LANG_GERMAN } " Syncplay-Interface für VLC installieren (ab VLC 2+) "
2014-11-29 15:01:45 +00:00
LangString ^ Shortcut $ $ { LANG_GERMAN } " Erstelle Verknüpfungen an folgenden Orten: "
2014-11-29 15:54:57 +00:00
LangString ^ BrowseVLCBtn $ $ { LANG_GERMAN } " VLC-Ordner wählen "
LangString ^ StartMenu $ $ { LANG_GERMAN } " Startmenü "
2014-11-29 15:01:45 +00:00
LangString ^ Desktop $ $ { LANG_GERMAN } " Desktop "
LangString ^ QuickLaunchBar $ $ { LANG_GERMAN } " Schnellstartleiste "
2015-01-03 13:58:18 +00:00
LangString ^ AutomaticUpdates $ $ { LANG_GERMAN } " Automatisch nach Updates suchen " ; TODO : Confirm German translation ( " Check for updates automatically " )
2014-11-29 15:01:45 +00:00
LangString ^ UninstConfig $ $ { LANG_GERMAN } " Konfigurationsdatei löschen. "
; Remove text to save space
LangString ^ ClickInstall $ $ { LANG_GERMAN } " "
2013-01-15 18:27:21 +00:00
PageEx license
LicenseData resources \license . txt
PageExEnd
2013-01-29 12:30:40 +00:00
Page custom DirectoryCustom DirectoryCustomLeave
2013-01-15 18:27:21 +00:00
Page instFiles
2014-11-29 13:56:26 +00:00
2013-01-29 14:15:40 +00:00
UninstPage custom un . installConfirm un . installConfirmLeave
2013-01-15 18:27:21 +00:00
UninstPage instFiles
2014-11-29 13:56:26 +00:00
2013-01-29 12:30:40 +00:00
Var Dialog
2013-01-29 14:15:40 +00:00
Var Icon_Syncplay
Var Icon_Syncplay_Handle
2013-01-29 12:30:40 +00:00
Var CheckBox_Associate
Var CheckBox_VLC
2015-01-03 13:58:18 +00:00
Var CheckBox_AutomaticUpdates
2013-01-29 12:30:40 +00:00
Var CheckBox_StartMenuShortcut
Var CheckBox_DesktopShortcut
Var CheckBox_QuickLaunchShortcut
Var CheckBox_Associate_State
Var CheckBox_VLC_State
2015-01-03 13:58:18 +00:00
Var CheckBox_AutomaticUpdates_State
2013-01-29 12:30:40 +00:00
Var CheckBox_StartMenuShortcut_State
Var CheckBox_DesktopShortcut_State
Var CheckBox_QuickLaunchShortcut_State
Var Button_Browse
2014-06-29 17:18:38 +00:00
Var Button_Browse_VLC
2013-01-29 12:30:40 +00:00
Var Directory
Var GroupBox_DirSub
Var Label_Text
Var Label_Shortcut
Var Label_Size
Var Label_Space
Var Text_Directory
2014-11-29 13:56:26 +00:00
2013-01-29 14:15:40 +00:00
Var Uninst_Dialog
Var Uninst_Icon
Var Uninst_Icon_Handle
Var Uninst_Label_Directory
Var Uninst_Label_Text
Var Uninst_Text_Directory
Var Uninst_CheckBox_Config
Var Uninst_CheckBox_Config_State
2014-11-29 13:56:26 +00:00
2013-01-29 12:30:40 +00:00
Var Size
Var SizeHex
Var AvailibleSpace
Var AvailibleSpaceGiB
Var Drive
Var VLC_Directory
2014-11-29 13:56:26 +00:00
2013-01-15 18:27:21 +00:00
! macro APP_ASSOCIATE EXT FileCLASS DESCRIPTION COMMANDTEXT COMMAND
WriteRegStr HKCR " .$$ {EXT} " " " " $$ {FileCLASS} "
WriteRegStr HKCR " $$ {FileCLASS} " " " ` $ $ { DESCRIPTION } `
WriteRegStr HKCR " $$ {FileCLASS} \ shell " " " " open "
WriteRegStr HKCR " $$ {FileCLASS} \ shell \ open " " " ` $ $ { COMMANDTEXT } `
WriteRegStr HKCR " $$ {FileCLASS} \ shell \ open \ command " " " ` $ $ { COMMAND } `
! macroend
2014-11-29 13:56:26 +00:00
2013-01-15 18:27:21 +00:00
! macro APP_UNASSOCIATE EXT FileCLASS
; Backup the previously associated File class
ReadRegStr $ $ R0 HKCR " .$$ {EXT} " ` $ $ { FileCLASS } _backup `
WriteRegStr HKCR " .$$ {EXT} " " " " $$R0 "
DeleteRegKey HKCR ` $ $ { FileCLASS } `
! macroend
2014-11-29 13:56:26 +00:00
2013-01-29 19:08:43 +00:00
! macro ASSOCIATE EXT
! insertmacro APP_ASSOCIATE " $$ {EXT} " " Syncplay.$$ {EXT} " " $$INSTDIR \ Syncplay.exe, %1% " \
" Open with Syncplay " " $$INSTDIR \ Syncplay.exe $$ \" % 1$$ \" "
! macroend
2014-11-29 13:56:26 +00:00
2013-01-29 19:08:43 +00:00
! macro UNASSOCIATE EXT
! insertmacro APP_UNASSOCIATE " $$ {EXT} " " Syncplay.$$ {EXT} "
! macroend
2014-11-29 13:56:26 +00:00
2013-01-29 12:30:40 +00:00
; Prevents from running more than one instance of installer and sets default state of checkboxes
Function . onInit
2014-06-29 17:18:38 +00:00
System : : Call ' kernel32::CreateMutexA(i 0, i 0, t " SyncplayMutex " ) i .r1 ?e '
2013-01-29 12:30:40 +00:00
Pop $ $ R0
StrCmp $ $ R0 0 + 3
MessageBox MB_OK | MB_ICONEXCLAMATION " The installer is already running. "
Abort
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
StrCpy $ $ CheckBox_Associate_State $ $ { BST_CHECKED }
StrCpy $ $ CheckBox_StartMenuShortcut_State $ $ { BST_CHECKED }
2014-06-29 17:18:38 +00:00
Call GetVLCDir
2014-07-14 20:27:10 +00:00
Call UpdateVLCCheckbox
2014-06-29 17:18:38 +00:00
2013-01-29 18:19:32 +00:00
Call GetSize
2013-01-29 12:30:40 +00:00
Call DriveSpace
Call Language
FunctionEnd
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
; Language selection dialog
Function Language
Push " "
Push $ $ { LANG_ENGLISH }
Push English
Push $ $ { LANG_POLISH }
Push Polski
2014-10-14 11:56:08 +00:00
Push $ $ { LANG_RUSSIAN }
2014-11-29 13:56:26 +00:00
Push Русский
2014-11-29 15:01:45 +00:00
Push $ $ { LANG_GERMAN }
Push Deutsch
2013-01-29 12:30:40 +00:00
Push A ; A means auto count languages
2014-06-29 19:56:18 +00:00
LangDLL : : LangDialog " Language Selection " " Please select the language of Syncplay and the installer "
2013-01-29 12:30:40 +00:00
Pop $ $ LANGUAGE
StrCmp $ $ LANGUAGE " cancel " 0 + 2
Abort
FunctionEnd
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
Function DirectoryCustom
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
nsDialogs : : Create 1018
Pop $ $ Dialog
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
GetFunctionAddress $ $ R8 DirectoryCustomLeave
nsDialogs : : OnBack $ $ R8
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
$ $ { NSD_CreateIcon } 0 u 0 u 22 u 20 u " "
2013-01-29 14:15:40 +00:00
Pop $ $ Icon_Syncplay
$ $ { NSD_SetIconFromInstaller } $ $ Icon_Syncplay $ $ Icon_Syncplay_Handle
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
$ $ { NSD_CreateLabel } 25 u 0 u 241 u 34 u " $$(^DirText) "
Pop $ $ Label_Text
2014-06-29 17:18:38 +00:00
$ $ { NSD_CreateText } 8 u 38 u 187 u 12 u " $$INSTDIR "
2013-01-29 12:30:40 +00:00
Pop $ $ Text_Directory
$ $ { NSD_SetFocus } $ $ Text_Directory
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
$ $ { NSD_CreateBrowseButton } 202 u 37 u 55 u 14 u " $$(^BrowseBtn) "
Pop $ $ Button_Browse
$ $ { NSD_OnClick } $ $ Button_Browse DirectoryBrowseDialog
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
$ $ { NSD_CreateGroupBox } 1 u 27 u 264 u 30 u " $$(^DirSubText) "
Pop $ $ GroupBox_DirSub
2015-01-03 13:58:18 +00:00
$ $ { NSD_CreateLabel } 0 u 122 u 132 8 u " $$(^SpaceRequired)$$SizeMB "
2013-01-29 12:30:40 +00:00
Pop $ $ Label_Size
2014-06-29 17:18:38 +00:00
2015-01-03 13:58:18 +00:00
$ $ { NSD_CreateLabel } 321 u 122 u 132 8 u " $$(^SpaceAvailable)$$AvailibleSpaceGiB.$$AvailibleSpaceGB "
2013-01-29 12:30:40 +00:00
Pop $ $ Label_Space
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
$ $ { NSD_CreateCheckBox } 8 u 59 u 187 u 10 u " $$(^Associate) "
Pop $ $ CheckBox_Associate
2014-06-29 17:18:38 +00:00
$ $ { NSD_CreateBrowseButton } 185 u 70 u 70 u 14 u " $$(^BrowseVLCBtn) "
Pop $ $ Button_Browse_VLC
$ $ { NSD_OnClick } $ $ Button_Browse_VLC DirectoryBrowseDialogVLC
2013-01-29 12:30:40 +00:00
$ $ { NSD_CreateCheckBox } 8 u 72 u 250 u 10 u " $$(^VLC) "
Pop $ $ CheckBox_VLC
2014-06-29 17:18:38 +00:00
2015-01-03 13:58:18 +00:00
$ $ { NSD_CreateCheckBox } 8 u 85 u 250 u 10 u " $$(^AutomaticUpdates) "
Pop $ $ CheckBox_AutomaticUpdates
$ $ { NSD_Check } $ $ CheckBox_AutomaticUpdates
$ $ { NSD_CreateLabel } 8 u 98 u 187 u 10 u " $$(^Shortcut) "
2013-01-29 12:30:40 +00:00
Pop $ $ Label_Shortcut
2014-06-29 17:18:38 +00:00
2015-01-03 13:58:18 +00:00
$ $ { NSD_CreateCheckbox } 8 u 111 u 60 u 10 u " $$(^StartMenu) "
2013-01-29 12:30:40 +00:00
Pop $ $ CheckBox_StartMenuShortcut
2015-01-03 13:58:18 +00:00
$ $ { NSD_CreateCheckbox } 78 u 111 u 70 u 10 u " $$(^Desktop) "
2013-01-29 12:30:40 +00:00
Pop $ $ CheckBox_DesktopShortcut
2014-06-29 17:18:38 +00:00
2015-01-03 13:58:18 +00:00
$ $ { NSD_CreateCheckbox } 158 u 111 u 130 u 10 u " $$(^QuickLaunchBar) "
2013-01-29 12:30:40 +00:00
Pop $ $ CheckBox_QuickLaunchShortcut
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
$ $ { If } $ $ CheckBox_Associate_State == $ $ { BST_CHECKED }
2013-05-28 20:50:42 +00:00
$ $ { NSD_Check } $ $ CheckBox_Associate
2013-01-29 12:30:40 +00:00
$ $ { EndIf }
$ $ { If } $ $ CheckBox_VLC_State == $ $ { BST_CHECKED }
$ $ { NSD_Check } $ $ CheckBox_VLC
$ $ { EndIf }
2014-06-29 17:18:38 +00:00
Call UpdateVLCCheckbox
2013-01-29 12:30:40 +00:00
$ $ { If } $ $ CheckBox_StartMenuShortcut_State == $ $ { BST_CHECKED }
$ $ { NSD_Check } $ $ CheckBox_StartMenuShortcut
$ $ { EndIf }
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
$ $ { If } $ $ CheckBox_DesktopShortcut_State == $ $ { BST_CHECKED }
$ $ { NSD_Check } $ $ CheckBox_DesktopShortcut
$ $ { EndIf }
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
$ $ { If } $ $ CheckBox_QuickLaunchShortcut_State == $ $ { BST_CHECKED }
$ $ { NSD_Check } $ $ CheckBox_QuickLaunchShortcut
$ $ { EndIf }
2014-06-29 17:18:38 +00:00
2015-01-03 13:58:18 +00:00
$ $ { If } $ $ CheckBox_AutomaticUpdates_State == $ $ { BST_CHECKED }
$ $ { NSD_Check } $ $ CheckBox_AutomaticUpdates
$ $ { EndIf }
2013-01-29 12:30:40 +00:00
nsDialogs : : Show
2013-01-29 14:15:40 +00:00
$ $ { NSD_FreeIcon } $ $ Icon_Syncplay_Handle
2013-01-29 12:30:40 +00:00
FunctionEnd
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
Function DirectoryCustomLeave
2013-01-29 17:49:41 +00:00
$ $ { NSD_GetText } $ $ Text_Directory $ $ INSTDIR
2013-01-29 12:30:40 +00:00
$ $ { NSD_GetState } $ $ CheckBox_Associate $ $ CheckBox_Associate_State
$ $ { NSD_GetState } $ $ CheckBox_VLC $ $ CheckBox_VLC_State
2015-01-03 13:58:18 +00:00
$ $ { NSD_GetState } $ $ CheckBox_AutomaticUpdates $ $ CheckBox_AutomaticUpdates_State
2013-01-29 12:30:40 +00:00
$ $ { NSD_GetState } $ $ CheckBox_StartMenuShortcut $ $ CheckBox_StartMenuShortcut_State
$ $ { NSD_GetState } $ $ CheckBox_DesktopShortcut $ $ CheckBox_DesktopShortcut_State
$ $ { NSD_GetState } $ $ CheckBox_QuickLaunchShortcut $ $ CheckBox_QuickLaunchShortcut_State
FunctionEnd
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
Function DirectoryBrowseDialog
2014-06-29 17:18:38 +00:00
nsDialogs : : SelectFolderDialog $ $ ( ^ DirBrowseText )
2013-01-29 12:30:40 +00:00
Pop $ $ Directory
$ $ { If } $ $ Directory != error
StrCpy $ $ INSTDIR $ $ Directory
$ $ { NSD_SetText } $ $ Text_Directory $ $ INSTDIR
Call DriveSpace
$ $ { NSD_SetText } $ $ Label_Space " $$(^SpaceAvailable)$$AvailibleSpaceGiB.$$AvailibleSpaceGB "
$ $ { EndIf }
Abort
FunctionEnd
2014-06-29 17:18:38 +00:00
Function GetVLCDir
IfFileExists " $$VLC_Directory \v lc.exe " VLCFound 0
ReadRegStr $ $ VLC_Directory HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " VLCInstallLocation "
IfFileExists " $$VLC_Directory \v lc.exe " VLCFound 0
ReadRegStr $ $ VLC_Directory HKLM " Software \ VideoLAN \ VLC " " InstallDir "
IfFileExists " $$VLC_Directory \v lc.exe " VLCFound 0
StrCpy $ $ VLC_Directory " c: \ program files (x86) \v ideolan \v lc "
IfFileExists " $$VLC_Directory \v lc.exe " VLCFound 0
StrCpy $ $ VLC_Directory " c: \ program files \v ideolan \v lc "
IfFileExists " $$VLC_Directory \v lc.exe " VLCFound 0
StrCpy $ $ VLC_Directory " "
VLCFound :
FunctionEnd
Function UpdateVLCCheckbox
IfFileExists " $$VLC_Directory \v lc.exe " VLC_Enabled VLC_Disabled
VLC_Enabled :
EnableWindow $ $ CheckBox_VLC 1
2014-07-14 20:27:10 +00:00
StrCpy $ $ CheckBox_VLC_State $ $ { BST_CHECKED }
$ $ { NSD_SetState } $ $ CheckBox_VLC $ $ CheckBox_VLC_State
2014-06-29 17:18:38 +00:00
goto CheckboxUpdated
VLC_Disabled :
EnableWindow $ $ CheckBox_VLC 0
2014-07-14 20:27:10 +00:00
StrCpy $ $ CheckBox_VLC_State $ $ { BST_UNCHECKED }
$ $ { NSD_SetState } $ $ CheckBox_VLC $ $ CheckBox_VLC_State
2014-06-29 17:18:38 +00:00
CheckboxUpdated :
FunctionEnd
Function DirectoryBrowseDialogVLC
nsDialogs : : SelectFolderDialog $ $ ( ^ BrowseVLCBtn ) $ $ VLC_Directory
Pop $ $ Directory
$ $ { If } $ $ Directory != error
StrCpy $ $ VLC_Directory $ $ Directory
Call UpdateVLCCheckbox
$ $ { EndIf }
Abort
FunctionEnd
2013-01-29 12:30:40 +00:00
Function GetSize
2013-01-29 18:19:32 +00:00
StrCpy $ $ Size " $totalSize "
IntOp $ $ Size $ $ Size / 1024
2013-01-29 12:30:40 +00:00
IntFmt $ $ SizeHex " 0x %08X " $ $ Size
IntOp $ $ Size $ $ Size / 1024
FunctionEnd
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
; Calculates Free Space on HDD
Function DriveSpace
StrCpy $ $ Drive $ $ INSTDIR 1
$ $ { DriveSpace } " $$Drive: \" " / D = F / S = M " $$AvailibleSpace
IntOp $ $ AvailibleSpaceGiB $ $ AvailibleSpace / 1024
IntOp $ $ AvailibleSpace $ $ AvailibleSpace % 1024
IntOp $ $ AvailibleSpace $ $ AvailibleSpace / 102
FunctionEnd
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
Function InstallOptions
$ $ { If } $ $ CheckBox_Associate_State == $ $ { BST_CHECKED }
Call Associate
DetailPrint " Associated Syncplay with multimedia files "
$ $ { EndIf }
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
$ $ { If } $ $ CheckBox_StartMenuShortcut_State == $ $ { BST_CHECKED }
CreateDirectory $ $ SMPROGRAMS \Syncplay
2014-06-29 17:18:38 +00:00
CreateShortCut " $$SMPROGRAMS \ Syncplay \ Syncplay.lnk " " $$INSTDIR \ Syncplay.exe " " "
CreateShortCut " $$SMPROGRAMS \ Syncplay \ Syncplay Server.lnk " " $$INSTDIR \ syncplayServer.exe " " "
2013-01-29 12:30:40 +00:00
CreateShortCut " $$SMPROGRAMS \ Syncplay \ Uninstall.lnk " " $$INSTDIR \ Uninstall.exe " " "
WriteINIStr " $$SMPROGRAMS \ Syncplay \ SyncplayWebsite.url " " InternetShortcut " " URL " " http://syncplay.pl "
$ $ { EndIf }
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
$ $ { If } $ $ CheckBox_DesktopShortcut_State == $ $ { BST_CHECKED }
CreateShortCut " $$DESKTOP \ Syncplay.lnk " " $$INSTDIR \ Syncplay.exe " " "
$ $ { EndIf }
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
$ $ { If } $ $ CheckBox_QuickLaunchShortcut_State == $ $ { BST_CHECKED }
CreateShortCut " $$QUICKLAUNCH \ Syncplay.lnk " " $$INSTDIR \ Syncplay.exe " " "
$ $ { EndIf }
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
$ $ { If } $ $ CheckBox_VLC_State == $ $ { BST_CHECKED }
2014-06-29 17:18:38 +00:00
IfFileExists " $$VLC_Directory \v lc.exe " 0 EndOfVLC
2013-01-29 12:30:40 +00:00
SetOutPath $ $ VLC_Directory \lua \intf
2013-07-19 10:32:54 +00:00
File resources \lua \intf \syncplay . lua
2014-06-29 17:18:38 +00:00
EndOfVLC :
2013-01-29 12:30:40 +00:00
$ $ { EndIf }
FunctionEnd
2014-06-29 17:18:38 +00:00
2013-01-15 18:27:21 +00:00
; Associates extensions with Syncplay
Function Associate
2013-01-29 19:08:43 +00:00
! insertmacro ASSOCIATE avi
! insertmacro ASSOCIATE mpg
! insertmacro ASSOCIATE mpeg
! insertmacro ASSOCIATE mpe
! insertmacro ASSOCIATE m1v
! insertmacro ASSOCIATE m2v
! insertmacro ASSOCIATE mpv2
! insertmacro ASSOCIATE mp2v
! insertmacro ASSOCIATE mkv
! insertmacro ASSOCIATE mp4
! insertmacro ASSOCIATE m4v
! insertmacro ASSOCIATE mp4v
! insertmacro ASSOCIATE 3 gp
! insertmacro ASSOCIATE 3 gpp
! insertmacro ASSOCIATE 3 g2
! insertmacro ASSOCIATE 3 pg2
! insertmacro ASSOCIATE flv
! insertmacro ASSOCIATE f4v
! insertmacro ASSOCIATE rm
! insertmacro ASSOCIATE wmv
! insertmacro ASSOCIATE swf
! insertmacro ASSOCIATE rmvb
! insertmacro ASSOCIATE divx
! insertmacro ASSOCIATE amv
2013-01-15 18:27:21 +00:00
FunctionEnd
2014-06-29 17:18:38 +00:00
2013-01-15 18:27:21 +00:00
Function WriteRegistry
2013-01-29 12:30:40 +00:00
Call GetSize
2013-01-15 18:27:21 +00:00
WriteRegStr HKLM SOFTWARE \Syncplay " Install_Dir " " $$INSTDIR "
WriteRegStr HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " DisplayName " " Syncplay "
2014-06-29 17:18:38 +00:00
WriteRegStr HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " InstallLocation " " $$INSTDIR "
WriteRegStr HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " VLCInstallLocation " " $$VLC_Directory "
2013-01-15 18:27:21 +00:00
WriteRegStr HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " UninstallString " ' " $$INSTDIR \ uninstall.exe " '
2013-01-26 21:10:28 +00:00
WriteRegStr HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " DisplayIcon " " $$INSTDIR \r esources \ icon.ico "
2013-01-15 18:27:21 +00:00
WriteRegStr HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " Publisher " " Syncplay "
2013-01-26 21:10:28 +00:00
WriteRegStr HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " DisplayVersion " " $version "
2013-01-15 18:27:21 +00:00
WriteRegStr HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " URLInfoAbout " " http://syncplay.pl/ "
WriteRegDWORD HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " NoModify " 1
WriteRegDWORD HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " NoRepair " 1
2013-01-29 12:30:40 +00:00
WriteRegDWORD HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " EstimatedSize " " $$SizeHex "
2014-06-29 19:56:18 +00:00
WriteINIStr $ $ APPDATA \syncplay . ini general language $ $ ( ^ SyncplayLanguage )
2015-01-03 13:58:18 +00:00
$ $ { If } $ $ CheckBox_AutomaticUpdates_State == $ $ { BST_CHECKED }
WriteINIStr $ $ APPDATA \syncplay . ini general CheckForUpdatesAutomatically " True "
$ $ { Else }
WriteINIStr $ $ APPDATA \syncplay . ini general CheckForUpdatesAutomatically " False "
$ $ { EndIf }
2013-01-15 18:27:21 +00:00
FunctionEnd
2014-06-29 17:18:38 +00:00
2013-01-29 14:15:40 +00:00
Function un . installConfirm
nsDialogs : : Create 1018
Pop $ $ Uninst_Dialog
2014-06-29 17:18:38 +00:00
2013-01-29 14:15:40 +00:00
$ $ { NSD_CreateIcon } 0 u 1 u 22 u 20 u " "
Pop $ $ Uninst_Icon
$ $ { NSD_SetIconFromInstaller } $ $ Uninst_Icon $ $ Uninst_Icon_Handle
2014-06-29 17:18:38 +00:00
2013-01-29 14:15:40 +00:00
$ $ { NSD_CreateLabel } 0 u 45 u 55 u 8 u " $$(^UninstallingSubText) "
Pop $ $ Uninst_Label_Directory
2014-06-29 17:18:38 +00:00
2013-01-29 14:15:40 +00:00
$ $ { NSD_CreateLabel } 25 u 0 u 241 u 34 u " $$(^UninstallingText) "
Pop $ $ Uninst_Label_Text
2014-06-29 17:18:38 +00:00
2013-01-29 14:15:40 +00:00
ReadRegStr $ $ INSTDIR HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " InstallLocation "
2014-06-29 17:18:38 +00:00
$ $ { NSD_CreateText } 56 u 43 u 209 u 12 u " $$INSTDIR "
2013-01-29 14:15:40 +00:00
Pop $ $ Uninst_Text_Directory
EnableWindow $ $ Uninst_Text_Directory 0
2014-06-29 17:18:38 +00:00
2013-01-29 14:15:40 +00:00
$ $ { NSD_CreateCheckBox } 0 u 60 u 250 u 10 u " $$(^UninstConfig) "
Pop $ $ Uninst_CheckBox_Config
2014-06-29 17:18:38 +00:00
2013-01-29 14:15:40 +00:00
nsDialogs : : Show
$ $ { NSD_FreeIcon } $ $ Uninst_Icon_Handle
FunctionEnd
2014-06-29 17:18:38 +00:00
2013-01-29 14:15:40 +00:00
Function un . installConfirmLeave
$ $ { NSD_GetState } $ $ Uninst_CheckBox_Config $ $ Uninst_CheckBox_Config_State
FunctionEnd
2014-06-29 17:18:38 +00:00
2013-01-15 18:27:21 +00:00
Function un . AssociateDel
2013-01-29 19:08:43 +00:00
! insertmacro UNASSOCIATE avi
! insertmacro UNASSOCIATE mpg
! insertmacro UNASSOCIATE mpeg
! insertmacro UNASSOCIATE mpe
! insertmacro UNASSOCIATE m1v
! insertmacro UNASSOCIATE m2v
! insertmacro UNASSOCIATE mpv2
! insertmacro UNASSOCIATE mp2v
! insertmacro UNASSOCIATE mkv
! insertmacro UNASSOCIATE mp4
! insertmacro UNASSOCIATE m4v
! insertmacro UNASSOCIATE mp4v
! insertmacro UNASSOCIATE 3 gp
! insertmacro UNASSOCIATE 3 gpp
! insertmacro UNASSOCIATE 3 g2
! insertmacro UNASSOCIATE 3 pg2
! insertmacro UNASSOCIATE flv
! insertmacro UNASSOCIATE f4v
! insertmacro UNASSOCIATE rm
! insertmacro UNASSOCIATE wmv
! insertmacro UNASSOCIATE swf
! insertmacro UNASSOCIATE rmvb
! insertmacro UNASSOCIATE divx
2014-06-29 17:18:38 +00:00
! insertmacro UNASSOCIATE amv
2013-01-15 18:27:21 +00:00
FunctionEnd
2014-06-29 17:18:38 +00:00
2013-01-29 12:30:40 +00:00
Function un . InstallOptions
Delete $ $ SMPROGRAMS \Syncplay \Syncplay . lnk
2014-06-29 17:18:38 +00:00
Delete " $$SMPROGRAMS \ Syncplay \ Syncplay Server.lnk "
2013-01-29 12:30:40 +00:00
Delete $ $ SMPROGRAMS \Syncplay \Uninstall . lnk
Delete $ $ SMPROGRAMS \Syncplay \SyncplayWebsite . url
RMDir $ $ SMPROGRAMS \Syncplay
Delete $ $ DESKTOP \Syncplay . lnk
Delete $ $ QUICKLAUNCH \Syncplay . lnk
2014-06-29 17:18:38 +00:00
ReadRegStr $ $ VLC_Directory HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay " " VLCInstallLocation "
IfFileExists " $$VLC_Directory \ lua \ intf \ syncplay.lua " 0 + 2
2013-01-29 12:30:40 +00:00
Delete $ $ VLC_Directory \lua \intf \syncplay . lua
2013-01-15 18:27:21 +00:00
FunctionEnd
2014-11-29 13:56:26 +00:00
2013-01-29 18:19:32 +00:00
Section " Install "
2013-01-15 18:27:21 +00:00
SetOverwrite on
SetOutPath $ $ INSTDIR
WriteUninstaller uninstall . exe
2014-11-29 13:56:26 +00:00
2013-01-16 14:00:57 +00:00
$ installFiles
2014-11-29 13:56:26 +00:00
2013-01-29 12:30:40 +00:00
Call InstallOptions
2013-01-26 21:10:28 +00:00
Call WriteRegistry
2013-01-15 18:27:21 +00:00
SectionEnd
2014-11-29 13:56:26 +00:00
2013-01-15 18:27:21 +00:00
Section " Uninstall "
Call un . AssociateDel
2013-01-29 12:30:40 +00:00
Call un . InstallOptions
2013-01-26 19:30:43 +00:00
$ uninstallFiles
2013-01-15 18:27:21 +00:00
DeleteRegKey HKLM " Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Syncplay "
DeleteRegKey HKLM SOFTWARE \Syncplay
Delete $ $ INSTDIR \uninstall . exe
2014-06-29 17:18:38 +00:00
RMDir $ $ INSTDIR \Syncplay \\resources \lua \intf
RMDir $ $ INSTDIR \Syncplay \\resources \lua
RMDir $ $ INSTDIR \Syncplay \\resources
2013-01-26 21:17:40 +00:00
RMDir $ $ INSTDIR \resources
RMDir $ $ INSTDIR \lib
2013-01-29 14:15:40 +00:00
RMDir $ $ INSTDIR
$ $ { If } $ $ Uninst_CheckBox_Config_State == $ $ { BST_CHECKED }
2014-06-29 17:18:38 +00:00
IfFileExists " $$APPDATA \ .syncplay " 0 + 2
2013-01-29 14:15:40 +00:00
Delete $ $ APPDATA \. syncplay
2014-06-29 17:18:38 +00:00
IfFileExists " $$APPDATA \ syncplay.ini " 0 + 2
Delete $ $ APPDATA \syncplay . ini
2013-01-29 14:15:40 +00:00
$ $ { EndIf }
2013-01-15 18:27:21 +00:00
SectionEnd
"""
class NSISScript ( object ) :
def create ( self ) :
2013-01-29 18:19:32 +00:00
fileList , totalSize = self . getBuildDirContents ( OUT_DIR )
print " Total size eq: {} " . format ( totalSize )
2013-01-16 14:00:57 +00:00
installFiles = self . prepareInstallListTemplate ( fileList )
uninstallFiles = self . prepareDeleteListTemplate ( fileList )
2014-07-02 22:20:31 +00:00
if os . path . isfile ( SETUP_SCRIPT_PATH ) :
2013-01-15 18:27:21 +00:00
raise RuntimeError ( " Cannot create setup script, file exists at {} " . format ( SETUP_SCRIPT_PATH ) )
2013-01-16 14:00:57 +00:00
contents = Template ( NSIS_SCRIPT_TEMPLATE ) . substitute (
version = syncplay . version ,
uninstallFiles = uninstallFiles ,
installFiles = installFiles ,
2013-01-29 18:19:32 +00:00
totalSize = totalSize ,
2013-01-16 14:00:57 +00:00
)
2013-01-15 18:27:21 +00:00
with open ( SETUP_SCRIPT_PATH , " w " ) as outfile :
outfile . write ( contents )
def compile ( self ) :
2014-07-02 22:20:31 +00:00
if not os . path . isfile ( NSIS_COMPILE ) :
2013-01-29 18:19:32 +00:00
return " makensis.exe not found, won ' t create the installer "
2013-01-15 18:27:21 +00:00
subproc = subprocess . Popen ( [ NSIS_COMPILE , SETUP_SCRIPT_PATH ] , env = os . environ )
subproc . communicate ( )
retcode = subproc . returncode
os . remove ( SETUP_SCRIPT_PATH )
if retcode :
raise RuntimeError ( " NSIS compilation return code: %d " % retcode )
2013-01-16 14:00:57 +00:00
def getBuildDirContents ( self , path ) :
fileList = { }
2013-01-29 18:19:32 +00:00
totalSize = 0
2013-01-16 14:00:57 +00:00
for root , _ , files in os . walk ( path ) :
2013-01-29 18:19:32 +00:00
totalSize + = sum ( os . path . getsize ( os . path . join ( root , file_ ) ) for file_ in files )
2013-01-16 14:00:57 +00:00
for file_ in files :
new_root = root . replace ( OUT_DIR , " " ) . strip ( " \\ " )
2014-07-02 22:20:31 +00:00
if not fileList . has_key ( new_root ) :
2013-01-16 14:00:57 +00:00
fileList [ new_root ] = [ ]
fileList [ new_root ] . append ( file_ )
2013-01-29 18:19:32 +00:00
return fileList , totalSize
2013-01-16 14:00:57 +00:00
def prepareInstallListTemplate ( self , fileList ) :
create = [ ]
for dir_ in fileList . iterkeys ( ) :
create . append ( ' SetOutPath " $INSTDIR \\ {} " ' . format ( dir_ ) )
for file_ in fileList [ dir_ ] :
create . append ( ' FILE " {} \\ {} \\ {} " ' . format ( OUT_DIR , dir_ , file_ ) )
return " \n " . join ( create )
def prepareDeleteListTemplate ( self , fileList ) :
delete = [ ]
for dir_ in fileList . iterkeys ( ) :
for file_ in fileList [ dir_ ] :
delete . append ( ' DELETE " $INSTDIR \\ {} \\ {} " ' . format ( dir_ , file_ ) )
delete . append ( ' RMdir " $INSTDIR \\ {} " ' . format ( file_ ) )
return " \n " . join ( delete )
2013-01-15 18:27:21 +00:00
class build_installer ( py2exe ) :
def run ( self ) :
py2exe . run ( self )
script = NSISScript ( )
script . create ( )
print " *** compiling the NSIS setup script*** "
script . compile ( )
print " *** DONE *** "
2013-06-08 16:57:57 +00:00
guiIcons = [ ' resources/accept.png ' , ' resources/arrow_undo.png ' , ' resources/clock_go.png ' ,
' resources/control_pause_blue.png ' , ' resources/cross.png ' , ' resources/door_in.png ' ,
' resources/folder_explore.png ' , ' resources/help.png ' , ' resources/table_refresh.png ' ,
2013-10-15 00:15:38 +00:00
' resources/timeline_marker.png ' , ' resources/control_play_blue.png ' ,
' resources/mpc-hc.png ' , ' resources/mpc-hc64.png ' , ' resources/mplayer.png ' ,
2014-07-11 19:44:01 +00:00
' resources/mpv.png ' , ' resources/vlc.png ' , ' resources/house.png ' , ' resources/film_link.png ' ,
2014-10-25 09:05:51 +00:00
' resources/eye.png ' , ' resources/comments.png ' , ' resources/cog_delete.png ' , ' resources/chevrons_right.png ' ,
2014-10-24 23:01:38 +00:00
' resources/user_key.png ' , ' resources/lock.png ' , ' resources/key_go.png ' , ' resources/page_white_key.png ' ,
2015-01-03 21:36:28 +00:00
' resources/tick.png ' , ' resources/lock_open.png ' , ' resources/empty_checkbox.png ' , ' resources/tick_checkbox.png ' ,
2015-07-19 13:15:25 +00:00
' resources/world_explore.png ' , ' resources/application_get.png ' , ' resources/cog.png ' ,
2015-08-30 19:31:49 +00:00
' resources/film_go.png ' , ' resources/world_go.png ' , ' resources/arrow_refresh.png '
2013-06-08 16:57:57 +00:00
]
2013-08-07 23:04:01 +00:00
resources = [ " resources/icon.ico " , " resources/syncplay.png " ]
2013-06-08 16:57:57 +00:00
resources . extend ( guiIcons )
2013-08-07 23:04:01 +00:00
intf_resources = [ " resources/lua/intf/syncplay.lua " ]
2013-06-08 16:57:57 +00:00
2012-10-12 16:37:12 +00:00
common_info = dict (
2012-10-15 18:33:24 +00:00
name = ' Syncplay ' ,
version = syncplay . version ,
2012-12-26 16:03:57 +00:00
author = ' Uriziel ' ,
2014-06-29 17:18:38 +00:00
author_email = ' dev@syncplay.pl ' ,
2012-10-15 18:33:24 +00:00
description = ' Syncplay ' ,
2012-10-12 16:37:12 +00:00
)
2013-01-15 18:27:21 +00:00
2012-10-12 16:37:12 +00:00
info = dict (
common_info ,
2013-06-08 13:00:44 +00:00
windows = [ { " script " : " syncplayClient.py " , " icon_resources " : [ ( 1 , " resources \\ icon.ico " ) ] , ' dest_base ' : " Syncplay " } ] ,
console = [ ' syncplayServer.py ' ] ,
2014-08-09 16:47:31 +00:00
# *** If you wish to make the Syncplay client use console mode (for --no-gui to work) then comment out the above two lines and uncomment the following line:
# console=['syncplayServer.py', {"script":"syncplayClient.py", "icon_resources":[(1, "resources\\icon.ico")], 'dest_base': "Syncplay"}],
2012-10-15 18:33:24 +00:00
options = { ' py2exe ' : {
2013-01-16 14:00:57 +00:00
' dist_dir ' : OUT_DIR ,
2013-05-28 20:50:42 +00:00
' packages ' : ' PySide.QtUiTools ' ,
2015-06-23 23:01:55 +00:00
' includes ' : ' twisted, sys, encodings, datetime, os, time, math, PySide, liburl, ast ' ,
2013-12-28 21:26:57 +00:00
' excludes ' : ' venv, _ssl, doctest, pdb, unittest, win32clipboard, win32file, win32pdh, win32security, win32trace, win32ui, winxpgui, win32pipe, win32process, Tkinter ' ,
2013-06-09 20:33:58 +00:00
' dll_excludes ' : ' msvcr71.dll, MSVCP90.dll, POWRPROF.dll ' ,
2012-10-12 16:37:12 +00:00
' optimize ' : 2 ,
' compressed ' : 1
}
2012-12-30 13:07:07 +00:00
} ,
2013-08-07 23:04:01 +00:00
data_files = [ ( " resources " , resources ) , ( " resources/lua/intf " , intf_resources ) ] ,
2012-12-30 13:07:07 +00:00
zipfile = " lib/libsync " ,
2013-01-15 18:27:21 +00:00
cmdclass = { " py2exe " : build_installer } ,
2012-10-12 16:37:12 +00:00
)
2013-01-15 18:27:21 +00:00
sys . argv . extend ( [ ' py2exe ' , ' -p win32com ' , ' -i twisted.web.resource ' ] )
2012-10-12 16:37:12 +00:00
setup ( * * info )