Skip to content

Commit

Permalink
messic radio plugin activator bugfix when activating the plugin witho…
Browse files Browse the repository at this point in the history
…ut the library installed at the system

nsis installer script updated
messic_console option for windows
  • Loading branch information
spheras committed Apr 3, 2016
1 parent 0d90879 commit 83eca18
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 164 deletions.
Binary file not shown.
55 changes: 51 additions & 4 deletions src/messic-assembly/bin/windows/nsis_installer/script.nsi
Expand Up @@ -2,6 +2,7 @@
!addplugindir ".\Include\AccessControl\Plugins\"
!include .\Include\ZipDLL\zipdll.nsh


# This installs two files, app.exe and logo.ico, creates a start menu shortcut, builds an uninstaller, and
# adds uninstall information to the registry for Add/Remove Programs

Expand All @@ -15,11 +16,11 @@
!define COMPANYNAME "messic"
!define DESCRIPTION "Music organizer and player"
#Files to include at the installer
!define ZIP_FILE "messic-1.0.0-beta.app.zip"
!define ZIP_FILE "messic-1.1.0.app.zip"
# These three must be integers
!define VERSIONMAJOR 1
!define VERSIONMINOR 0
!define VERSIONBUILD 0-beta
!define VERSIONMINOR 1
!define VERSIONBUILD 0
# These will be displayed by the "Click here for support information" link in "Add/Remove Programs"
# It is possible to use "mailto:" links in here to open the email client
!define HELPURL "http://spheras.github.io/messic/" # "Support Information" link
Expand All @@ -29,7 +30,18 @@
# This is the size (in kB) of all the files copied into "Program Files"
!define INSTALLSIZE 122880

XPStyle on
RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on)

; First is default
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
LoadLanguageFile "${NSISDIR}\Contrib\Language files\Spanish.nlf"
LoadLanguageFile "${NSISDIR}\Contrib\Language files\Catalan.nlf"

LangString uninstall_previous_message ${LANG_ENGLISH} "${APPNAME} is already installed. $\n$\nClick 'OK' to remove the previous version (remember that the uninstall DON'T remove your music folder) or `Cancel` to cancel this upgrade. $\nWARNING: before uninstall, be sure to STOP the messic service if it is running."
LangString uninstall_previous_message ${LANG_SPANISH} "${APPNAME} ya está instalado. $\n$\nHaz Click en 'OK' para eliminar la instalación previa de messic (recuerda que la desinstalación NO elimina la carpeta de música) o 'Cancelar' para cancelar esta instalación. $\nIMPORTANTE: antes de desinstalar asegúrate de que el servicio messic está parado."
LangString uninstall_previous_message ${LANG_CATALAN} "${APPNAME} ja està instal·lat. $\n$\nFes clic a 'OK' per eliminar la instal·lació prèvia d'messic (recorda que la desinstal·lació NO elimina la carpeta de música) o 'Cancel·la' per cancel·lar aquesta instal·lació. $\nIMPORTANT: abans de desinstal·lar assegura't que el servei messic està aturat."


InstallDir "$PROGRAMFILES\${APPNAME}"

Expand Down Expand Up @@ -61,6 +73,42 @@ ${EndIf}
function .onInit
setShellVarContext all
!insertmacro VerifyUserIsAdmin

;code to uninstall previously the installed messic
ReadRegStr $R0 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" \
"UninstallString"
StrCmp $R0 "" done

MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"$(uninstall_previous_message)" \
IDOK uninst
Abort

;Run the uninstaller
uninst:
ClearErrors
;Exec $INSTDIR\uninstall.exe ; instead of the ExecWait line
ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file

IfErrors no_remove_uninstaller done
;You can either use Delete /REBOOTOK in the uninstaller or add some code
;here to remove the uninstaller. Use a registry key to check
;whether the user has chosen to uninstall. If you are using an uninstaller
;components page, make sure all sections are uninstalled.
no_remove_uninstaller:

done:

;we check again
ReadRegStr $R0 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" \
"UninstallString"
StrCmp $R0 "" doneagain
Abort

doneagain:

functionEnd

section "install"
Expand Down Expand Up @@ -122,7 +170,6 @@ function un.onInit
functionEnd

section "uninstall"

# Remove Start Menu launcher
delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk"
delete "$SMPROGRAMS\${COMPANYNAME}\uninstall.lnk"
Expand Down
9 changes: 5 additions & 4 deletions src/messic-assembly/bin/windows/readme-creatensisinstall.txt
Expand Up @@ -2,7 +2,8 @@ This instructions details the creation of the nsis .exe installer

1. first download nsis and install it at any windows computer
2. Modify the file nsis_installer/script.nsi, the line 18, something like (!define ZIP_FILE "messic-1.0.0-beta.app.zip"), to the new zip name
3. copy there the zip of messic
4. IMPORTANT! ensure that the zip contains directly messic (by default the zip contains a folder which contains messic).
5. compile with nsis the script at nsis_installer/script.nsi
6. that's all!
3. Modify the version numbering major minor build
4. copy there the zip of messic
5. IMPORTANT! ensure that the zip contains directly messic (by default the zip contains a folder which contains messic).
6. compile with nsis the script at nsis_installer/script.nsi
7. that's all!
146 changes: 0 additions & 146 deletions src/messic-assembly/bin/windows/script.nsi

This file was deleted.

5 changes: 5 additions & 0 deletions src/messic-assembly/src/assembly/dep-windows.xml
Expand Up @@ -75,6 +75,11 @@
<outputDirectory>./</outputDirectory>
<destName>messic_admin.exe</destName>
</file>
<file>
<source>./bin/windows/messic_console.exe</source>
<outputDirectory>./</outputDirectory>
<destName>messic_console.exe</destName>
</file>
</files>


Expand Down
Expand Up @@ -36,16 +36,28 @@ public class Activator
**/
public void start( BundleContext bundleContext )
{
String sversion = LibShout.get().getVersion();
if ( !sversion.equals( "2.3.1" ) )
try
{
logger.warn( "icecast2 version " + sversion );
}
logger.info( "Radio - Icecast2 Started" );

Hashtable<String, String> props = new Hashtable<String, String>();
props.put( MessicRadioPlugin.MESSIC_RADIO_PLUGIN_NAME, MessicRadioPluginIceCast2.NAME );
bundleContext.registerService( MessicRadioPlugin.class.getName(), new MessicRadioPluginIceCast2(), props );
String sversion = LibShout.get().getVersion();
if ( !sversion.equals( "2.3.1" ) )
{
logger.warn( "icecast2 version " + sversion );
}
logger.info( "Radio - Icecast2 Started" );

Hashtable<String, String> props = new Hashtable<String, String>();
props.put( MessicRadioPlugin.MESSIC_RADIO_PLUGIN_NAME, MessicRadioPluginIceCast2.NAME );
bundleContext.registerService( MessicRadioPlugin.class.getName(), new MessicRadioPluginIceCast2(), props );
}
catch ( Exception e )
{
logger.info( "Radio - Icecast2 Not Available" );
}
catch ( Error e )
{
logger.info( "Radio - Icecast2 Not Available" );
}

}

Expand Down
Expand Up @@ -81,9 +81,20 @@ private void checkConnection()
{
if ( isStarted() )
{
if ( !LibShout.get().isConnected() )
try
{
if ( !LibShout.get().isConnected() )
{
this.info.status = MessicRadioStatus.NOT_STARTED;
}
}
catch ( Exception e )
{
this.info.status = MessicRadioStatus.NOT_ENABLED;
}
catch ( Error e )
{
this.info.status = MessicRadioStatus.NOT_STARTED;
this.info.status = MessicRadioStatus.NOT_ENABLED;
}
}
}
Expand Down

0 comments on commit 83eca18

Please sign in to comment.