Skip to content

Commit

Permalink
#13 #14 #15, NSIS unified versions, FW Clone or Copy
Browse files Browse the repository at this point in the history
  • Loading branch information
jcecconi committed Jun 7, 2015
1 parent 3874c53 commit b658425
Show file tree
Hide file tree
Showing 18 changed files with 205 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
/**/local-repo
/**/Linux*
# Own Config file
Config_Inst_MUI_CIAA_IDE_Suite_v1'1'0.nsh
Config_Installer_CIAA_IDE_Suite.nsh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
;##############################################################################
;
; Copyright 2014, 2015, Juan Cecconi
; Copyright 2014, 2015, Martin Ribelotta
; Copyright 2014, 2015, Natalia Requejo
; Copyright 2015, Juan Cecconi
;
; This file is part of CIAA IDE.
;
Expand Down Expand Up @@ -34,7 +32,7 @@
;
;##############################################################################

; Copy this file to Config_Inst_MUI_CIAA_IDE_Suite_v1'1'0.nsh
; Copy this file to Config_Installer_CIAA_IDE_Suite.nsh
; and define which sections and files you want to include
;
!define INSTALL_CYGWIN
Expand Down
6 changes: 2 additions & 4 deletions win32/IDE4PLC-dl.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
::##############################################################################
::
:: Copyright 2014, ACSE & CADIEEL
:: ACSE : http://www.sase.com.ar/asociacion-civil-sistemas-embebidos/ciaa/
:: CADIEEL: http://www.cadieel.org.ar
:: Copyright 2015, Juan Cecconi
::
:: This file is part of CIAA Firmware.
:: This file is part of CIAA IDE.
::
:: Redistribution and use in source and binary forms, with or without
:: modification, are permitted provided that the following conditions are met:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,42 +36,33 @@
;
SetCompressor /SOLID lzma

; Rename Config_Inst_MUI_CIAA_IDE_Suite_v1'1'0.config as Config_Inst_MUI_CIAA_IDE_Suite_v1'1'0.nsh
; Rename Config_Installer_CIAA_IDE_Suite.config as Config_Installer_CIAA_IDE_Suite.nsh
; and define which sections and files you want to include
!include "Config_Inst_MUI_CIAA_IDE_Suite_v1'1'0.nsh"
!include "Config_Installer_CIAA_IDE_Suite.nsh"
;
!include "x64.nsh"
!include "WinVer.nsh"

;Include Modern UI
!include "MUI.nsh"
!include "MUI.nsh"
;
Function .onInit
# the plugins dir is automatically deleted when the installer exits
InitPluginsDir
File /oname=$PLUGINSDIR\splash.bmp "Images\Logo.bmp"
splash::show 3000 $PLUGINSDIR\splash

Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normally, and '-1' if some error occurred.
${If} ${AtLeastWinXP}
; At least Windows XP !!!
${else}
MessageBox MB_ICONSTOP "Necesita al menos Windows XP para instalar 'CIAA-IDE-Suite'"
Quit
${EndIf}
FunctionEnd
; Define Vars with version of each section
!include "Versions_Installer_CIAA_IDE_Suite.nsh"

; Vars
Var Firmware_Section_Last_Sel ; Mutually Exclusive Section (Repo / Copy)
;
;--------------------------------
;
;LoadLanguageFile "${NSISDIR}\Contrib\Language files\Spanish.nlf"
;
;
; The name of the installer
Name "CIAA-IDE-Suite"
Name "CIAA-IDE-Suite v${CIAA_IDE_SUITE_VERSION}"

; The file to write
OutFile "Setup_CIAA_IDE_Suite_v1_1_0.exe"
OutFile "Setup_CIAA_IDE_Suite_v${CIAA_IDE_SUITE_VERSION}.exe"

; The default installation directory
InstallDir C:\CIAA
Expand Down Expand Up @@ -105,14 +96,14 @@ InstallDir C:\CIAA

!insertmacro MUI_LANGUAGE "Spanish"
;
VIAddVersionKey /LANG=${LANG_SPANISH} "ProductName" "CIAA IDE Suite"
VIAddVersionKey /LANG=${LANG_SPANISH} "ProductName" "CIAA IDE Suite v${CIAA_IDE_SUITE_VERSION}"
VIAddVersionKey /LANG=${LANG_SPANISH} "Comments" "Instalador de CIAA-IDE-Suite"
VIAddVersionKey /LANG=${LANG_SPANISH} "CompanyName" "Proyecto-CIAA"
VIAddVersionKey /LANG=${LANG_SPANISH} "LegalTrademarks" ""
VIAddVersionKey /LANG=${LANG_SPANISH} "LegalCopyright" "Proyecto-CIAA © 2015"
VIAddVersionKey /LANG=${LANG_SPANISH} "FileDescription" "Instalador del IDE completo para la CIAA"
VIAddVersionKey /LANG=${LANG_SPANISH} "FileVersion" "1.1.0"
VIProductVersion "1.1.0.0"
VIAddVersionKey /LANG=${LANG_SPANISH} "FileVersion" ${CIAA_IDE_SUITE_VERSION}
VIProductVersion "${CIAA_IDE_SUITE_VERSION}.0"
;--------------------------------
; Si termina de instalar Ok,
; pongo el desinstalador !!!
Expand All @@ -129,7 +120,7 @@ Function .onInstSuccess
WriteUninstaller "uninstall.exe"
; TODO Add driver code here
FunctionEnd

;--------------------------------
; Secciones
;--------------------------------
Expand Down Expand Up @@ -158,30 +149,37 @@ SectionEnd
!endif
;
!ifdef INSTALL_FIRMWARE
Section "Firmware-v0.4.1" Sec_Firmware

; Set output path to the installation directory.
SetOutPath $INSTDIR
SubSection "Firmware v${FIRMWARE_VERSION}" Sec_Firmware
;
!ifndef SKIP_INSTALL_FIRMWARE_FILES
; Put file there
File /r Firmware
!endif
Section "Firmware Clone Repo" Sec_Firmware_Repo
!ifndef SKIP_CLONE_FIRMWARE_REPO
; Set output path to the installation directory.
SetOutPath $INSTDIR
System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("CIAA_SUITE_PATH", "$INSTDIR").r0'
StrCmp $0 0 Env_Var_Error
File /oname=Firmware_Clone.bat Firmware_Clone.bat
ExecWait '"$INSTDIR\Firmware_Clone.bat"' $0
Delete "$INSTDIR\Firmware_Clone.bat"
Goto done
Env_Var_Error:
MessageBox MB_OK "No puede definirse la variable de entorno para el Path de instalacion"
done:
!endif
SectionEnd

Section /o "Copia de Firmware v${FIRMWARE_VERSION}" Sec_Firmware_Copy
!ifndef SKIP_INSTALL_FIRMWARE_FILES
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File /r Firmware
!endif
SectionEnd
SectionEnd
SubSectionEnd
!endif
;
!ifdef INSTALL_IDE4PLC
Section "IDE4PLC-v1.0.0" Sec_IDE4PLC
Section "IDE4PLC v${IDE4PLC_VERSION}" Sec_IDE4PLC

; Set output path to the installation directory.
SetOutPath $INSTDIR
Expand Down Expand Up @@ -383,7 +381,9 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${Sec_Cygwin} "Permite trabajar en un entorno posix like y Eclipse, para usar el toolchain gnu"
!endif
!ifdef INSTALL_FIRMWARE
!insertmacro MUI_DESCRIPTION_TEXT ${Sec_Firmware} "Permite programar la CIAA mediente lenguaje C, basado en el Firmware 0.4.1, siendo solo copia del repo (no es clonado con git!)"
!insertmacro MUI_DESCRIPTION_TEXT ${Sec_Firmware} "Permite programar la CIAA mediente lenguaje C, basado en el CIAA Firmware"
!insertmacro MUI_DESCRIPTION_TEXT ${Sec_Firmware_Repo} "Descarga online del repositorio mediante 'git clone' de CIAA Firmware, y hace un branch al tag v${FIRMWARE_VERSION}"
!insertmacro MUI_DESCRIPTION_TEXT ${Sec_Firmware_Copy} "Instala solo UNA COPIA de CIAA Firmware v${FIRMWARE_VERSION}"
!endif
!ifdef INSTALL_DRIVERS
!insertmacro MUI_DESCRIPTION_TEXT ${Sec_Drivers} "Permite instalar los drivers, pero debe contar con el Hardware!!!"
Expand All @@ -397,4 +397,79 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${SecMenuInicio} "Accesos Directos en el Menu Inicio"
!insertmacro MUI_DESCRIPTION_TEXT ${SecEscritorio} "Accesos Directos en el Escritorio"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;
;
;--------------------------------
;
;--------------------------------
Function .onInit
# the plugins dir is automatically deleted when the installer exits
InitPluginsDir
File /oname=$PLUGINSDIR\splash.bmp "Images\Logo.bmp"
splash::show 3000 $PLUGINSDIR\splash

Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normally, and '-1' if some error occurred.
${If} ${AtLeastWinXP}
; At least Windows XP !!!
${else}
MessageBox MB_ICONSTOP "Necesita al menos Windows XP para instalar 'CIAA-IDE-Suite'"
Quit
${EndIf}
;
Push $1

StrCpy $Firmware_Section_Last_Sel ${Sec_Firmware_Repo} ; Default Section...
SectionGetFlags ${Sec_Firmware_Repo} $1
IntOp $1 $1 | ${SF_SELECTED}
SectionSetFlags ${Sec_Firmware_Repo} $1

SectionGetFlags ${Sec_Firmware_Copy} $1
IntOp $1 $1 & ${SECTION_OFF}
SectionSetFlags ${Sec_Firmware_Copy} $1

Pop $1
FunctionEnd

;--------------------------------
;
;--------------------------------
Function .onSelChange
Push $1
Push $2
Push $3

SectionGetFlags ${Sec_Firmware_Repo} $1
IntOp $1 $1 & ${SF_SELECTED}
SectionGetFlags ${Sec_Firmware_Copy} $2
IntOp $2 $2 & ${SF_SELECTED}

IntOp $3 $1 | $2
${If} $3 == "0"
StrCpy $Firmware_Section_Last_Sel ""
Return
${EndIf}

StrCmp $Firmware_Section_Last_Sel ${Sec_Firmware_Repo} Old_Was_FW_Repo
; Sec_Firmware_Repo was unselected...Is it selected now? => unselect Sec_Firmware_Copy
${If} $1 == "1"
SectionGetFlags ${Sec_Firmware_Copy} $1
IntOp $1 $1 & ${SECTION_OFF}
SectionSetFlags ${Sec_Firmware_Copy} $1
StrCpy $Firmware_Section_Last_Sel ${Sec_Firmware_Repo}
${EndIf}
Goto ExitSelChange
Old_Was_FW_Repo:
; Sec_Firmware_Copy was unselected...Is it selected now? => unselect Sec_Firmware_Repo
${If} $2 == "1"
;MessageBox MB_ICONINFORMATION "E:"
SectionGetFlags ${Sec_Firmware_Repo} $2
IntOp $2 $2 & ${SECTION_OFF}
SectionSetFlags ${Sec_Firmware_Repo} $2
StrCpy $Firmware_Section_Last_Sel ${Sec_Firmware_Copy}
${EndIf}

ExitSelChange:
Pop $3
Pop $2
Pop $1
FunctionEnd
44 changes: 44 additions & 0 deletions win32/Installer_Versions.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
::##############################################################################
::
:: Copyright 2015, Juan Cecconi
::
:: This file is part of CIAA IDE.
::
:: Redistribution and use in source and binary forms, with or without
:: modification, are permitted provided that the following conditions are met:
::
:: 1. Redistributions of source code must retain the above copyright notice,
:: this list of conditions and the following disclaimer.
::
:: 2. Redistributions in binary form must reproduce the above copyright notice,
:: this list of conditions and the following disclaimer in the documentation
:: and/or other materials provided with the distribution.
::
:: 3. Neither the name of the copyright holder nor the names of its
:: contributors may be used to endorse or promote products derived from this
:: software without specific prior written permission.
::
:: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
:: AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
:: IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
:: ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
:: LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
:: CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
:: SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
:: INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
:: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
:: ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
:: POSSIBILITY OF SUCH DAMAGE.
::
::##############################################################################
@echo off

echo Defining environment variables...
set FIRMWARE_VERSION="0.5.0"
set OPENOCD_VERSION="0.9.0"
set NSIS_VERSION="2.46"
set IDE4PLC_VERSION="1.0.1"
set FTDI_XP_VERSION="2.10.00"
set FTDI_WIN7_VERSION="2.12.00"
set ZADIG_XP_VERSION="2.1.1"
set ZADIG_WIN7_VERSION="2.1.1"
10 changes: 5 additions & 5 deletions win32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ Esto crear
* cygwin Directorio de instalación de cygwin (debe habilitar la linea "rem cyg-install.bat" en el archivo prepare.bat)
* eclipse-cdt conteniendo el JRE
* arm-none-eabi-gcc desde launchpad
* Firmware desde el repositorio de CIAA-Firmware
* Firmware desde el repositorio de CIAA-Firmware (Clone o Copia del tag)
* FTDI_Driver
* usbdriver
* NSIS
* IDE4PLC por ahora desde un ZIP externo
* IDE4PLC desde el repositorio de CIAA-IDE4PLC, mediante zip del tag correspondiente
* openocd desde el repositorio de freddy chopins
* Testcase de compilacion de linea de comandos

Luego crear el instalador:
* Copiar Config_Inst_MUI_CIAA_IDE_Suite_v1'1'0.config como Config_Inst_MUI_CIAA_IDE_Suite_v1'1'0.nsh y definerque secciones y archivos quiere incluir
* Ejecutar make-installer.bat en una consola y esperar un rato a que termine...el archivo Setup_CIAA_IDE_Suite_v1_1_0.exe se creará en esta carpeta.
* Copiar Config_Installer_CIAA_IDE_Suite.config como Config_Installer_CIAA_IDE_Suite.nsh y definer que secciones y archivos quiere incluir
* Ejecutar make-installer.bat en una consola y esperar un rato a que termine...el archivo Setup_CIAA_IDE_Suite_vX_Y_Z.exe se creará en esta carpeta.


TODO
----
- IDE4PLC descargable desde el repo (no está subido aún)
- Mediente variables de entorno en Installer_Versions.bat, unificar scripts de download y NSIS segun versiones indicadas, centralizando las actualizaciones
- Realizar un *.ini con los parámetros de eclipse correspondientes
- workspace por defecto, perspectiva a usar -cdt-, etc.)
- Realizar *.ini de instalación del driver
Expand Down
38 changes: 38 additions & 0 deletions win32/Versions_Installer_CIAA_IDE_Suite.nsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
;##############################################################################
;
; Copyright 2015, Juan Cecconi
;
; This file is part of CIAA IDE.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; 1. Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
;
; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
;
; 3. Neither the name of the copyright holder nor the names of its
; contributors may be used to endorse or promote products derived from this
; software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;##############################################################################
;
; define version number
!define CIAA_IDE_SUITE_VERSION "1.2.0"
!define FIRMWARE_VERSION "0.5.0"
!define IDE4PLC_VERSION "1.0.1"
Empty file modified win32/cyg-download.bat
100644 → 100755
Empty file.
Empty file modified win32/cyg-install.bat
100644 → 100755
Empty file.
Empty file modified win32/cyg-package.bat
100644 → 100755
Empty file.
Empty file modified win32/do-nsis.bat
100644 → 100755
Empty file.
Empty file modified win32/eclipse-dl.bat
100644 → 100755
Empty file.
Empty file modified win32/get-tools.bat
100644 → 100755
Empty file.
Empty file modified win32/get-wget.bat
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions win32/make-installer.bat
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
::##############################################################################
@echo off
CD %~dp0
echo creating installer
nsis\makensis.exe /V1 Inst_MUI_CIAA_IDE_Suite_v1'1'0.nsi
echo "Creating CIAA_IDE_Suite Installer..."
nsis\makensis.exe /V1 Installer_CIAA_IDE_Suite.nsi
Empty file modified win32/nsis-dl.bat
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion win32/openocd-dl.bat
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:: ACSE : http://www.sase.com.ar/asociacion-civil-sistemas-embebidos/ciaa/
:: CADIEEL: http://www.cadieel.org.ar
::
:: This file is part of CIAA Firmware.
:: This file is part of CIAA IDE.
::
:: Redistribution and use in source and binary forms, with or without
:: modification, are permitted provided that the following conditions are met:
Expand Down
Empty file modified win32/prepare.bat
100644 → 100755
Empty file.

0 comments on commit b658425

Please sign in to comment.