SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-27-2015, 06:53 AM
scoful's Avatar
scoful scoful is offline
Sage Aficionado
 
Join Date: Jun 2006
Location: Lawrence, Kansas
Posts: 373
Having a hard time with upgrading EXE's

Quote:
Originally Posted by dinki View Post
Andy,

I just updated v7.1 to v9 and had to jump around to a few different places to find all the files needed. I figured I'd document what I did and perhaps it would be useful to others. Perhaps you can use it, or pieces of it, for the FAQ. I did a clean install of v7.1 and updated from there:

How to update v7.1 to v9:

1. Install v7.1 or start with a v7.1 system. Be sure to make a backup of your SageTV directory if updating.
2. Close SageTV and make sure the service is stopped via the SageTVServiceControl.exe application
3. Download the v9 windows exe files and overwrite the existing files in your SageTV install directory. These files can usually be found at C:\Program Files (x86)\SageTV\SageTV
4. Download the v9 sagetv.jar and overwrite the existing file in your SageTV install directory. This file can usually be found at C:\Program Files (x86)\SageTV\SageTV
5. Download the lucene-core file and copy/overwrite it in your SageTV install's jar directory. This file can usually be found at C:\Program Files (x86)\SageTV\SageTV\JARs . Hint: You need to click 'View Raw' to start the download.
6. Optional: If you have a valid SageTV license, you can follow these steps to set an environment variable to access EPG data provided by Google.
7. Start SageTV and browse to Setup->System Information and check that your Software Version is SageTV V9.0.0.4
I can't seem to get this to work when running Sage as a service. The service starts fine but the SageTV app on the server and SageTVClient app on clients can't connect to the service. I thought I'd be nice and package all of the upgrade stuff up into a 7zip file with a nice batch file to install all of it (which seems to work great - prompts user for license key to setup environment variable, stops the server service and kills any other sage processes, guesses installation path (x86 vs x64) etc.

What am I missing here?

Batch File for the curious:
Code:
@echo off
REM Last revision 9/26/2015
xcopy /y sage*.exe %TEMP%\SageTV9\
xcopy /y jars\*.jar %TEMP%\SageTV9\jars\
set USERTEMP=%TEMP%
CLS 
ECHO.
ECHO =============================
ECHO SageTV V9 Upgrade
ECHO =============================

:checkPrivileges 
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges ) 

:getPrivileges 
if '%1'=='ELEV' (shift & goto gotPrivileges)  
ECHO. 
ECHO **************************************
ECHO SageTV V9 Upgrade
ECHO **************************************

setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs" 
ECHO UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs" 
"%temp%\OEgetPrivileges.vbs" 
exit /B 

:gotPrivileges 
::::::::::::::::::::::::::::
:START
::::::::::::::::::::::::::::
setlocal & pushd .

REM Run shell as admin 

setlocal
:PROMPT
SET /P AREYOUSURE=Have you removed the Lucene Plugin? (Y/[N])?
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END
Goto DoIt

:END
rem endlocal
echo Install Aborted.
pause
exit

:DoIt
endlocal
cls

set /p SageKey="Sage License Key (Only required for Server): " %=%
setx -m SAGETVUSERKEY %SageKey%

if exist "c:\program files\SageTV\SageTV\SageTVPlayer.exe" goto x86
if exist "c:\program files (x86)\SageTV\SageTV\SageTVPlayer.exe" goto x64

echo I can't find your SageTV Installation - Operation Aborted.
pause
exit
:x86
echo Stopping SageTV Applications & Services
net stop sagetv
taskkill /f /im:SageTV.exe
taskkill /f /im:SageTVClient.exe
taskkill /f /im:SageTVService.exe
del "c:\program files\SageTV\SageTV\JARs\lucen*.jar"
xcopy /s /y %USERTEMP%\SageTV9\*.* "c:\program files\SageTV\SageTV\"
goto finished
:x64
echo Stopping SageTV Applications & Services
net stop sagetv
taskkill /f /im:SageTV.exe
taskkill /f /im:SageTVClient.exe
taskkill /f /im:SageTVService.exe
del "c:\program files (x86)\SageTV\SageTV\JARs\lucen*.jar"
xcopy /s /y %USERTEMP%\SageTV9\*.* "c:\program files (x86)\SageTV\SageTV\"
goto finished

:finished
echo Update Complete
net start sagetv
pause
exit
__________________
SageTV 9 / 3 SageTV Clients / Ceton InfiniTV 6 / ComSkip
Reply With Quote
  #2  
Old 09-27-2015, 07:11 AM
dinki's Avatar
dinki dinki is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 682
Service mode is not working for me either. I thought it was just me having this problem. Not sure how to diagnose.
__________________
Intel Core i5-2500, 16GB RAM, OMV Linux 4.17, 3 TB of Data
SageTV 9 Docker, Open DCT Docker
Silicondust HDHomeRun Duo + Quatro
Sage Mini Client on Amazon Fire Sticks and Android TVs
Reply With Quote
  #3  
Old 09-27-2015, 07:15 AM
scoful's Avatar
scoful scoful is offline
Sage Aficionado
 
Join Date: Jun 2006
Location: Lawrence, Kansas
Posts: 373
Dang!

Quote:
Originally Posted by dinki View Post
Service mode is not working for me either. I thought it was just me having this problem. Not sure how to diagnose.
Ok - well I'm glad it's not just me. FYI - it appears once the service runs it changes the WIZ.BIN so it's no longer compatible with 7.1. I'm pretty sure I had seen that in the notes somewhere and had made a backup. I suppose I should add backing up the WIZ.BIN and SAGE.PROPERTIES files while I'm at it.
__________________
SageTV 9 / 3 SageTV Clients / Ceton InfiniTV 6 / ComSkip
Reply With Quote
  #4  
Old 09-27-2015, 08:34 AM
dinki's Avatar
dinki dinki is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 682
So it converts out back when in app mode? I've switched back to app mode after service mode problems without any problem.
__________________
Intel Core i5-2500, 16GB RAM, OMV Linux 4.17, 3 TB of Data
SageTV 9 Docker, Open DCT Docker
Silicondust HDHomeRun Duo + Quatro
Sage Mini Client on Amazon Fire Sticks and Android TVs
Reply With Quote
  #5  
Old 09-27-2015, 08:55 AM
FreshOne FreshOne is offline
Sage Advanced User
 
Join Date: Dec 2007
Posts: 80
Quote:
Originally Posted by scoful View Post
I thought I'd be nice and package all of the upgrade stuff up into a 7zip file with a nice batch file to install all of it (which seems to work great - prompts user for license key to setup environment variable, stops the server service and kills any other sage processes, guesses installation path (x86 vs x64) etc.
Great idea with the batch file. If you are thinking of publishing it when you are done, here are some thoughts:

You can use net stop to stop the Sage Service rather than killing it.
You might want to back up the upgraded files (maybe with sage7 extension) before deleting them ?
Reply With Quote
  #6  
Old 09-27-2015, 02:35 PM
scoful's Avatar
scoful scoful is offline
Sage Aficionado
 
Join Date: Jun 2006
Location: Lawrence, Kansas
Posts: 373
Quote:
Originally Posted by FreshOne View Post
Great idea with the batch file. If you are thinking of publishing it when you are done, here are some thoughts:

You can use net stop to stop the Sage Service rather than killing it.
You might want to back up the upgraded files (maybe with sage7 extension) before deleting them ?
It does attempt to stop the service with NET STOP but follows up with taskkill just in case it doesn't stop it (otherwise the overcopy would fail). I've since added lines to backup the wiz.bin and properties files with time/date names in case the script is run more than once. I figure at least the EXE's can be reinstalled, but you'd be hosed without the wiz.bin and properties files.

I was planning on 7zipping it up into a self extracting archive with all the exe's and jars. I suppose I should really have it determine if it's a client install and only copy the truly necessary files - it's just quick and dirty the way it is, but I figure nobody has shortcuts to the unnecessary files anyway.
__________________
SageTV 9 / 3 SageTV Clients / Ceton InfiniTV 6 / ComSkip

Last edited by scoful; 09-27-2015 at 02:43 PM.
Reply With Quote
  #7  
Old 09-27-2015, 02:36 PM
scoful's Avatar
scoful scoful is offline
Sage Aficionado
 
Join Date: Jun 2006
Location: Lawrence, Kansas
Posts: 373
Quote:
Originally Posted by dinki View Post
So it converts out back when in app mode? I've switched back to app mode after service mode problems without any problem.
So did you get it to work running as a service? My server is headless so I don't want to run in app mode.
__________________
SageTV 9 / 3 SageTV Clients / Ceton InfiniTV 6 / ComSkip
Reply With Quote
  #8  
Old 09-27-2015, 03:54 PM
dinki's Avatar
dinki dinki is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 682
No. Service mode does not work for me at all. I've tried a few things and cannot get it to work. I'm guessing this does not create logs of any type so not sure what to do.
__________________
Intel Core i5-2500, 16GB RAM, OMV Linux 4.17, 3 TB of Data
SageTV 9 Docker, Open DCT Docker
Silicondust HDHomeRun Duo + Quatro
Sage Mini Client on Amazon Fire Sticks and Android TVs
Reply With Quote
  #9  
Old 09-28-2015, 03:11 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Are you sure you're using the most recent .exe builds? The files in the post lined to in your first post are not the most recent, and specifically didn't work in service mode. There are newer builds later in that thread that fixed the service issue.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #10  
Old 09-28-2015, 04:48 AM
scoful's Avatar
scoful scoful is offline
Sage Aficionado
 
Join Date: Jun 2006
Location: Lawrence, Kansas
Posts: 373
Quote:
Originally Posted by Fuzzy View Post
Are you sure you're using the most recent .exe builds? The files in the post lined to in your first post are not the most recent, and specifically didn't work in service mode. There are newer builds later in that thread that fixed the service issue.
Fuzzy - can you post a link to the new EXE's please? I backtracked through and downloaded from further down the discussion but I can't see a difference - file sizes and version info are identical.

If we could get a closed sticky going for the Windows builds that would be really cool to make them easier to find. I've modified my batch file installer to FTP download the current executables before it runs too so if the FTP folder is kept up to date all that has to be done is run the batch file to pull the updates before it copies them over.

I've updated the batch file code if someone wants to check it out. I haven't had time to test it this morning, but it should download all of the EXE's and JAR's from my FTP server as well as the current version of the update script. After the download it will restart the script and verify it's the current version and copy the updates over.

Code:
@echo off
REM Last revision 9/28/2015
xcopy /y sage*.exe %TEMP%\SageTV9\
xcopy /y jars\*.jar %TEMP%\SageTV9\jars\
set USERTEMP=%TEMP%
CLS
 
ECHO.
ECHO =============================
ECHO SageTV V9 Upgrade
ECHO =============================

:checkPrivileges 
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges ) 

:getPrivileges 
if '%1'=='ELEV' (shift & goto gotPrivileges)  
ECHO. 
ECHO **************************************
ECHO SageTV V9 Upgrade
ECHO **************************************

setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs" 
ECHO UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs" 
"%temp%\OEgetPrivileges.vbs" 
exit /B 

:gotPrivileges 
::::::::::::::::::::::::::::
:START
::::::::::::::::::::::::::::
setlocal & pushd .

REM Run shell as admin 

setlocal
setlocal DisableDelayedExpansion

:PROMPT
SET /P AREYOUSURE=Have you removed the Lucene Plugin? (Y/[N])?
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END
Goto DoIt

:END
rem endlocal
echo Install Aborted.
pause
exit

:DoIt
endlocal


REM Create ftp profile to download update components

REM Create Firewall Exception for Native FTP Client
netsh advfirewall firewall add rule name="FTP Client" dir=in action=allow program="%windir%\System32\ftp.exe" enable=yes

REM Create Local Temp Folders to store updates
del /q "%USERTEMP%\SageTV9\*.*"
del /q "%USERTEMP%\SageTV9\jars\*.*"
md "%USERTEMP%\SageTV9"
md "%USERTEMP%\SageTV9\jars"

REM Check Script Version

set ThisVersion=150929A
echo Script Version %ThisVersion%
set ReRunFlag=0
echo %USERTEMP%
set /p SCRIPTVER=<"%USERTEMP%\scriptver.txt"
If '%SCRIPTVER%'=='%ThisVersion%' goto NoNeedToUpdate

:SetScriptVersion
echo %ThisVersion%>"%USERTEMP%\scriptver.txt"
echo %SCRIPTVER%=%ThisVersion%
goto CreateFTPScript

:CreateFTPScript
echo open ftp1.dpi.bz> "%USERTEMP%\SageTV9\updates.ftp"
echo anonymous>> "%USERTEMP%\SageTV9\updates.ftp"
echo guest>> "%USERTEMP%\SageTV9\updates.ftp"
echo lcd /D "%USERTEMP%\SageTV">> "%USERTEMP%\SageTV9\updates.ftp"
echo cd Installers/>> "%USERTEMP%\SageTV9\updates.ftp"
echo cd SageTV9/>> "%USERTEMP%\SageTV9\updates.ftp"
echo binary>> "%USERTEMP%\SageTV9\updates.ftp"
echo mget *.*>> "%USERTEMP%\SageTV9\updates.ftp"
rem Download jars Subfolder Contents
echo lcd "%USERTEMP%\SageTV9\jars">> "%USERTEMP%\SageTV\updates.ftp"
echo cd jars/>> "%USERTEMP%\SageTV9\updates.ftp"
echo binary>> "%USERTEMP%\SageTV9\updates.ftp"
echo mget *.*>> "%USERTEMP%\SageTV9\updates.ftp"
rem Wrap up FTP Connection
echo disconnect>> "%USERTEMP%\SageTV9\updates.ftp"
echo quit>> "%USERTEMP%\SageTV9\updates.ftp"

REM Execute FTP Script
Echo Downloading Updates
ftp -g -i -s:"%USERTEMP%\SageTV9\updates.ftp"
Echo Updates Downloaded.

Echo Restarting Updated Script.
start "" "%USERTEMP%\SageTV9\UpgradeSageTV7_1to9.bat"
exit

:NoNeedToUpdate
REM Script Is Current - Proceed With Updates

set /p SageKey="Sage License Key (Only required for Server): " %=%
setx -m SAGETVUSERKEY %SageKey%
set mdate="%date:~7,2%-%date:~4,2%-%date:~10,4%"
set fname=%mdate%
set ftime=%time:~0,2%%time:~3,2%%time:~6,2%

if exist "c:\program files\SageTV\SageTV\SageTVPlayer.exe" goto x86
if exist "c:\program files (x86)\SageTV\SageTV\SageTVPlayer.exe" goto x64

echo I can't find your SageTV Installation - Operation Aborted.
pause
exit

:x86
set SagePath="c:\program files\SageTV\SageTV"
goto UpdateIt

:x64
set SagePath="c:\program files (x86)\SageTV\SageTV"
goto UpdateIt

:UpdateIt
echo Stopping SageTV Applications & Services
net stop sagetv
taskkill /f /im:SageTV.exe
taskkill /f /im:SageTVClient.exe
taskkill /f /im:SageTVService.exe
del "%SagePath%\JARs\lucen*.jar"

rem make backup copies to time/date stamped folder
xcopy "%SagePath%\Sage*.exe" "%SagePath%\Backups\%fname%%ftime%\" 
xcopy "%SagePath%\WIZ.BIN" "%SagePath%\Backups\%fname%%ftime%\"
xcopy "%SagePath%\Sage*.PROPERTIES" "%SagePath%\Backups\%fname%%ftime%\"
xcopy /s /y %USERTEMP%\SageTV9\*.* "%SagePath%\"
goto finished

:finished
echo Update Complete
netsh advfirewall firewall delete rule name="FTP Client" program="%windir%\System32\ftp.exe"
del "%USERTEMP%\scriptver.txt"
net start sagetv
pause
exit
I could host the exe's on my FTP server if need be.
__________________
SageTV 9 / 3 SageTV Clients / Ceton InfiniTV 6 / ComSkip

Last edited by scoful; 09-29-2015 at 05:42 AM.
Reply With Quote
  #11  
Old 09-28-2015, 06:34 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Realized that he went in and edited the old post to include the updated EXE's. Those should be working. What is the service doing for you guys?
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #12  
Old 09-28-2015, 06:49 AM
scoful's Avatar
scoful scoful is offline
Sage Aficionado
 
Join Date: Jun 2006
Location: Lawrence, Kansas
Posts: 373
Quote:
Originally Posted by Fuzzy View Post
Realized that he went in and edited the old post to include the updated EXE's. Those should be working. What is the service doing for you guys?
It starts fine and seems like maybe I could start sage on the server but clients couldn't connect. I redid firewall exceptions thinking maybe windows firewall wasn't giving the exception due to a change in the exe.

I did examine the link I downloaded from and it appeared to be different from one further down the thread, so the files I put on my ftp server should be current, but won't have time to test the script or the new exe's for a couple of days unless I have a bout of insomnia tonight - which is not entirely unlikely.
__________________
SageTV 9 / 3 SageTV Clients / Ceton InfiniTV 6 / ComSkip
Reply With Quote
  #13  
Old 09-28-2015, 06:53 AM
dinki's Avatar
dinki dinki is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 682
Quote:
Originally Posted by Fuzzy View Post
Realized that he went in and edited the old post to include the updated EXE's. Those should be working. What is the service doing for you guys?
Right. This is why I linked to those 'original' files in my post. It sounded like it had been changed.

Quote:
Originally Posted by scoful View Post
It starts fine and seems like maybe I could start sage on the server but clients couldn't connect. I redid firewall exceptions thinking maybe windows firewall wasn't giving the exception due to a change in the exe.

I did examine the link I downloaded from and it appeared to be different from one further down the thread, so the files I put on my ftp server should be current, but won't have time to test the script or the new exe's for a couple of days unless I have a bout of insomnia tonight - which is not entirely unlikely.
So there's another version in the thread that's different than the one I linked? I'll have to give that a try.

Sorry for the trouble I may have caused. All the more reason to bundle things up to be less confusing.
__________________
Intel Core i5-2500, 16GB RAM, OMV Linux 4.17, 3 TB of Data
SageTV 9 Docker, Open DCT Docker
Silicondust HDHomeRun Duo + Quatro
Sage Mini Client on Amazon Fire Sticks and Android TVs
Reply With Quote
  #14  
Old 09-28-2015, 07:18 AM
dinki's Avatar
dinki dinki is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 682
I guess I spoke to soon. Service mode appears to be working for me now. I managed to get it working by going into windows services and manually starting the service. At first I thought it was still broken as I could not see the web server, but after a couple of minutes the web server did start responding. I guess the service is just taking a lot longer than I'm used to.

I did have an issue with SageTVServiceControl.exe giving me an error saying that the service did not start in a timely fashion earlier after coming back to Win7. Everything appears to be working fine now. Perhaps just give it a bit more time and it may actually be working for you as well.
__________________
Intel Core i5-2500, 16GB RAM, OMV Linux 4.17, 3 TB of Data
SageTV 9 Docker, Open DCT Docker
Silicondust HDHomeRun Duo + Quatro
Sage Mini Client on Amazon Fire Sticks and Android TVs
Reply With Quote
  #15  
Old 09-28-2015, 07:51 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
On the first start with a new version, it will usually take longer, as it validates and updates the wiz.bin.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
hard drive idle spin down power down sleep inactivity time etc korben_dallas Hardware Support 1 01-23-2010 06:51 AM
Hard time getting Hallmark to show up.. spazmanian SageTV EPG Service 0 12-19-2009 10:16 AM
Video does not continue from where it stopped last time (after upgrading) Moskus SageTV Placeshifter 1 02-26-2009 06:54 AM
Daylight Savings Time and NTFS time stamps - 1 hour off? Opus4 The SageTV Community 2 11-01-2006 11:34 PM
hard time with USB-UIRT and Sony IO Cable box jrbig Hardware Support 1 03-29-2005 02:53 PM


All times are GMT -6. The time now is 05:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.