Skip to content

Commit

Permalink
Merge pull request #1 from large/develop
Browse files Browse the repository at this point in the history
Update to TLS1.2 + Kodi script to Matrix V19 support
  • Loading branch information
large authored Mar 12, 2021
2 parents 4a05373 + a2fb3b1 commit 9669fde
Show file tree
Hide file tree
Showing 32 changed files with 337 additions and 129 deletions.
10 changes: 5 additions & 5 deletions Installer/Installer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{98DE6E8B-FFBF-468B-973E-31892046B29B}</ProjectGuid>
<RootNamespace>Installer</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down
Binary file removed Installer/MOTRInstall-1.41beta.exe
Binary file not shown.
Binary file removed Installer/MOTRInstall-1.45beta.exe
Binary file not shown.
Binary file added Installer/MOTRInstall-1.9beta.exe
Binary file not shown.
85 changes: 77 additions & 8 deletions Installer/MOTRdInstaller.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Movies On The Run (MOTR)"
!define PRODUCT_VERSION "1.46betaGit"
!define PRODUCT_VERSION "1.9beta"
!define PRODUCT_PUBLISHER "Lars Werner"
!define PRODUCT_WEB_SITE "http://lars.werner.no/motrd/"
!define PRODUCT_DIR_REGKEY "Software\MOTR\InstallerPath"
Expand Down Expand Up @@ -89,6 +89,9 @@ Function .onInit
Quit
${EndIf}

;Check which dot.net we have installed
call CheckAndInstallDotNet

!insertmacro MUI_LANGDLL_DISPLAY
!insertmacro INSTALLOPTIONS_EXTRACT "serviceinstaller.ini"
!insertmacro INSTALLOPTIONS_EXTRACT "initialinstallation.ini"
Expand Down Expand Up @@ -149,6 +152,7 @@ Section -Post
pop $1
DetailPrint $1
DetailPrint "Creating SSL certificate"

;Create certificate in the directory installed
nsExec::ExecToStack '"$INSTDIR\MOTRd.exe" -CERT'
pop $0
Expand All @@ -171,13 +175,13 @@ Section -Post
;Creates a URL
WriteIniStr "$INSTDIR\Links\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"

CreateShortCut "${PRODUCT_STARTMENU}\Movies On The Run (console mode).lnk" "$INSTDIR\MOTRd.exe" "" "$INSTDIR\MOTRd.exe" 0

CreateShortCut "${PRODUCT_STARTMENU}\Scripts.lnk" "${PRODUCT_SCRIPTS}" "" "${PRODUCT_SCRIPTS}" 0

CreateShortCut "${PRODUCT_STARTMENU}\Visit MOTR online.lnk" "$INSTDIR\Links\${PRODUCT_NAME}.url" "" "$INSTDIR\link.ico" 0
CreateShortCut "${PRODUCT_STARTMENU}\InstallerLicense.lnk" "$INSTDIR\InstallerLicense.txt" "" "$INSTDIR\InstallerLicense.txt" 0
CreateShortCut "${PRODUCT_STARTMENU}\Uninstall.lnk" "$INSTDIR\Uninstaller-MOTR.exe" "" "$INSTDIR\Uninstaller-MOTR.exe" 0
;Create start menu items
CreateShortCut "${PRODUCT_STARTMENU}\Domain certification.lnk" "${PRODUCT_SCRIPTS}\domaincert.bat" "" "${PRODUCT_SCRIPTS}\domaincert.bat" 0
CreateShortCut "${PRODUCT_STARTMENU}\Movies On The Run (console mode).lnk" "$INSTDIR\MOTRd.exe" "" "$INSTDIR\MOTRd.exe" 0
CreateShortCut "${PRODUCT_STARTMENU}\InstallerLicense.lnk" "$INSTDIR\InstallerLicense.txt" "" "$INSTDIR\InstallerLicense.txt" 0
CreateShortCut "${PRODUCT_STARTMENU}\Scripts.lnk" "${PRODUCT_SCRIPTS}" "" "${PRODUCT_SCRIPTS}" 0
CreateShortCut "${PRODUCT_STARTMENU}\Visit MOTR online.lnk" "$INSTDIR\Links\${PRODUCT_NAME}.url" "" "$INSTDIR\link.ico" 0
CreateShortCut "${PRODUCT_STARTMENU}\Uninstall.lnk" "$INSTDIR\Uninstaller-MOTR.exe" "" "$INSTDIR\Uninstaller-MOTR.exe" 0
SectionEnd


Expand Down Expand Up @@ -275,6 +279,7 @@ Function ServiceInstallerPost
;Create the bat-scripts needed
call CreateServiceInstallerBat
call CreateServiceUnInstallerBat
call CreateCertDomainBat

;Check if the port selected is available
${If} ${TCPPortOpen} $R1
Expand Down Expand Up @@ -439,4 +444,68 @@ Function CreateServiceUnInstallerBat
FileClose $0
FunctionEnd


Function CreateCertDomainBat
FileOpen $0 "${PRODUCT_SCRIPTS}\domaincert.bat" "w"
FileWrite $0 "@ECHO OFF$\r$\n"
FileWrite $0 "REM Check if command prompt is elevated$\r$\n"
FileWrite $0 "net session >nul 2>&1$\r$\n"
FileWrite $0 "if %errorLevel% == 0 ($\r$\n"
FileWrite $0 " goto STARTING$\r$\n"
FileWrite $0 ") else ($\r$\n"
FileWrite $0 " ECHO Warning: This script needs to be runned as administrator.$\r$\n"
FileWrite $0 " pause$\r$\n"
FileWrite $0 " goto THEEND$\r$\n"
FileWrite $0 ")$\r$\n"
FileWrite $0 ":STARTING$\r$\n"
FileWrite $0 "cd $\"${PRODUCT_INSTALLDIRECTORY}$\"$\r$\n"
FileWrite $0 "ECHO Please enter top-level domainname.$\r$\n"
FileWrite $0 "ECHO Example: site.com$\r$\n"
FileWrite $0 "ECHO (Do not enter sub domains like motr.site.com)$\r$\n"
FileWrite $0 "ping 127.0.0.1 -n 5 -w 2000 >nul$\r$\n"
FileWrite $0 "ECHO. $\r$\n"
FileWrite $0 "ECHO Please stop MOTRd before you proceed to gain access to keyfile$\r$\n"
FileWrite $0 "ping 127.0.0.1 -n 5 -w 2000 >nul$\r$\n"
FileWrite $0 "ECHO. $\r$\n"
FileWrite $0 "ECHO Enter domain and press ENTER to continue or CTRL+C to abort$\r$\n"
FileWrite $0 "ECHO. $\r$\n"
FileWrite $0 "set /p id=$\"Domain: $\"$\r$\n"
FileWrite $0 "MOTRd.exe -CERT %id%$\r$\n"
FileWrite $0 "ECHO. $\r$\n"
FileWrite $0 "ECHO Please restart MOTRd if the cert-file creation was OK$\r$\n"
FileWrite $0 "pause$\r$\n"
FileWrite $0 ":THEEND$\r$\n"
FileWrite $0 "exit$\r$\n"
FileClose $0
FunctionEnd


Function CheckAndInstallDotNet
; Magic numbers from http://msdn.microsoft.com/en-us/library/ee942965.aspx
ClearErrors
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Release"

IfErrors NotDetected

; 4.7.2 on all Windows version that support it
${If} $0 >= 461814

DetailPrint "Microsoft .NET Framework 4.7.2 is installed ($0)"
${Else}
NotDetected:
DetailPrint "Installing Microsoft .NET Framework 4.7.2"
SetDetailsPrint listonly
ExecWait '"$INSTDIR\Tools\dotNetFx45_Full_setup.exe" /passive /norestart' $0
${If} $0 == 3010
${OrIf} $0 == 1641
DetailPrint "Microsoft .NET Framework 4.7.2 installer requested reboot"
SetRebootFlag true
${EndIf}
SetDetailsPrint lastused
DetailPrint "Microsoft .NET Framework 4.7.2 installer returned $0"
${EndIf}

FunctionEnd


;-------------- END BAT SCRIPTS
7 changes: 4 additions & 3 deletions Installer/PackfilestoZip.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

REM Start with the MOTRd files
set archivename="MOTRd.zip"
set sourcepath="C:\Source\MOTRd"
set sourcepath="C:\Users\Large\source\repos\MOTRd"
set sourcepathbin="%sourcepath%\MOTRd\bin\Release\"
set sourcepathmime="%sourcepath%\WebSockets\"
set zipfile=7za.exe a -tzip -bd -bb0 "%archivename%"
Expand Down Expand Up @@ -32,8 +32,8 @@ del /S %archivename2%
REM Copy the Android installfile motr.apk to the webfiles
mkdir %sourcepath2%\android
del /S %sourcepath2%\android\motr.apk
set sourcepath3=C:\Source\MOTRApp\MOTRApp\MOTRApp.Android\bin\Release
copy %sourcepath3%\Lars.Werner.MOTR-Signed.apk %sourcepath2%\android\motr.apk
set sourcepath3=C:\Users\Large\source\repos\MOTRApp\MOTRApp\MOTRApp.Android\bin\Release
copy %sourcepath3%\com.larswerner.motr-Signed.apk %sourcepath2%\android\motr.apk

REM Copy all the webfiles
mkdir WebFiles
Expand All @@ -46,4 +46,5 @@ REM Now launch the NSIS installer
"C:\Program Files (x86)\NSIS\Bin\makensis" MOTRdInstaller.nsi
del /S %archivename%
del /S %archivename2%
pause
exit
19 changes: 10 additions & 9 deletions Kodi/script.motr/addon.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.motr" name="Movies On The Run" version="0.2.6" provider-name="Lars Werner">
<addon id="script.motr" name="Movies On The Run" version="19.0.2" provider-name="Lars Werner">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="xbmc.python" version="3.0.0"/>
</requires>
<extension point="xbmc.python.script" library="main.py">
<provides>executable</provides>
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en_GB">Kodi client for connecting to your MOTR server.
<summary lang="en_GB">Updated for Kodi Matrix!
Kodi client for connecting to your MOTR server.
Convert, stream or download your movies in Kodi on the go.

Remember queue is common for all users, hold the line.

Plug-in has been tested with Android, Nvidia Shield, Linux/OpenElec and Windows. Please inform me if it works on a Mac :)</summary>
Plug-in has been tested with Android, Nvidia Shield, Linux/OpenElec, Mac and Windows.</summary>
<description lang="en_GB"></description>
<language>en</language>
<platform>all</platform>
Expand All @@ -21,14 +22,14 @@ Plug-in has been tested with Android, Nvidia Shield, Linux/OpenElec and Windows.
<website>www.motr.pw</website>
<source>www.motr.pw</source>
<email>[email protected]</email>
<news>Soon to be a RC?</news>
<news>Support for 19.0 Matrix, now a Video-plugin</news>
<disclaimer>Session, username and password are stored in clear text in Kodi, use other clients for security</disclaimer>
<assets>
<icon>icon.png</icon>
<fanart>fanart.jpg</fanart>
<screenshot>screenshot1.jpg</screenshot>
<screenshot>screenshot2.jpg</screenshot>
<screenshot>screenshot3.jpg</screenshot>
<screenshot>screenshot-1.jpg</screenshot>
<screenshot>screenshot-2.jpg</screenshot>
<screenshot>screenshot-3.jpg</screenshot>
</assets>
</extension>
</addon>
6 changes: 3 additions & 3 deletions Kodi/script.motr/resources/lib/kodiutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def dialogyesno(header, line1, line2='', line3=''):
return xbmcgui.Dialog().yesno(header, line1, line2, line3) #True on yes

def dialogokerror(line1, line2='', line3=''):
xbmcgui.Dialog().ok(__lang__(30101), line1, line2, line3)
xbmcgui.Dialog().ok(__lang__(30101), line1 + "[CR]" + line2 + "[CR]" + line3)

def dialogstreamordownload(header):
return xbmcgui.Dialog().select(header, [__lang__(30102), __lang__(30114), __lang__(30103), __lang__(30007)])
Expand All @@ -44,7 +44,7 @@ def show_settings():
ADDON.openSettings()

def get_setting(setting):
return ADDON.getSetting(setting).strip().decode('utf-8')
return ADDON.getSetting(setting).strip()

def set_setting(setting, value):
ADDON.setSetting(setting, str(value))
Expand All @@ -65,5 +65,5 @@ def get_setting_as_int(setting):
return 0

def get_string(string_id):
return ADDON.getLocalizedString(string_id).encode('utf-8', 'ignore')
return ADDON.getLocalizedString(string_id)

6 changes: 3 additions & 3 deletions Kodi/script.motr/resources/lib/motrconvertdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import unicode_literals

from traceback import print_exc
import os, sys, re, socket, urllib, urllib2, unicodedata, threading, time
import os, sys, re, socket, urllib, unicodedata, threading, time
from resources.lib import kodiutils
#from resources.lib import kodilogging
import logging
Expand Down Expand Up @@ -202,7 +202,7 @@ def __init__(self, *args, **kwargs):
#print( '{0} = {1}'.format(name, value))

def onInit(self):
print "Dialog init"
print("Dialog init")
self.AddProfiles()
self.SetFilename("") #No profile selected at startup

Expand All @@ -229,7 +229,7 @@ def onClick(self, controlID):
self.CheckIfValidProfile(0) #Cancel

def CheckIfValidProfile(self, nReturn):
if len(self.sProfile) == 0 and nReturn is not 0:
if len(self.sProfile) == 0 and nReturn != 0:
kodiutils.dialogokerror(__lang__(30300), __lang__(30301))
return
self.nReturnStatus = nReturn
Expand Down
4 changes: 2 additions & 2 deletions Kodi/script.motr/resources/lib/motrwebsocket.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import xbmc, xbmcaddon
from resources.lib import kodiutils

import ws4py
from ws4py.client.threadedclient import WebSocketClient
from .ws4py import *
from .ws4py.client.threadedclient import WebSocketClient

import sys
import threading
Expand Down
Loading

0 comments on commit 9669fde

Please sign in to comment.