Skip to content

Commit c49eee0

Browse files
committed
Automatizando proceso de empaquetado
1 parent aeee51a commit c49eee0

10 files changed

+105
-152
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@
2323
- Puertos e instrucciones I/O
2424
- Características avanzadas de macros
2525

26+
## Compilación
27+
28+
Para generar los ejecutables y el instalador desde un sistema Unix, se requieren las siguientes dependencias:
29+
30+
- `makensis` para generar el instalador para Windows
31+
- `node` y `neu` para generar los ejecutables
32+
- `gcab` para empaquetar la versión portable para Windows
33+
- `sed` para versionar automáticamente los archivos fuente
34+
35+
En la terminal, ejecuta `./preparar.sh todo $version`, donde `$version` es el número de versión a generar. Eso generará todos los archivos para distribuir. Para limpiar el espacio de trabajo, puedes ejecutar `./preparar.sh limpiar`.
36+
37+
Para hacerlo desde un sistema Windows, el proceso debería ser similar, o también se puede utilizar WSL.
38+
2639
## Créditos
2740

2841
- Integrantes del equipo, en orden alfabético:
@@ -32,11 +45,14 @@
3245
- Santiago Rodríguez
3346
- Carlos Villaseñor
3447
- **Logotipo**:
35-
- Fue tomado del [tema de íconos Papirus](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme)
48+
- Creado por Santiago Rodríguez
3649
- Tiene licencia GPLv3
3750
- **NeutralinoJS**:
3851
- Usamos NeutralinoJS para generar los binarios para Windows y Linux
3952
- Tiene licencia MIT
53+
- **NSIS**:
54+
- Usamos NSIS para generar los instaladores para Windows
55+
- Tiene licencia zlib
4056
- **Tipografías**:
4157
- Predeterminadamente, usamos dos tipografías:
4258
- *Carlito*: reemplazo libre de Calibri, para el texto base

doc/readme.md renamed to doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
En este espacio puede encontrar ayuda para utilizar el programa. Esta ayuda se divide en dos partes:
44

5-
* **[Manual de usuario](usuario.adoc)**: Dirigida a explicar el funcionamiento y las opciones disponibles del propio programa
5+
* **Manual de usuario** ([es](usuario.es.adoc), [en](usuario.en.adoc)): Dirigida a explicar el funcionamiento y las opciones disponibles del propio programa
66
* **[Manual técnico](tecnico.adoc)**: Dirigida a explicar el formato ensamblador implementado, así como las directivas reconocidas
77

88
Esperamos que este contenido les sea de utilidad, y siempre puede informar sobre sugerencias, peticiones y correcciones en la [sección de Incidencias](https://github.com/twilight1794/z80/issues) de GitHub.

instalador.nsi

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,45 @@
1-
!include MUI2.nsh
2-
!define VERSION "1.0.0"
3-
!define NOMBRE "Emulador Z80"
1+
!define NOMBRE "RetroZ80Simulator"
42
!define NOMBRE_CORTO "z80"
3+
!define COMENTARIO "Ensamblador y emulador libre del microprocesador Zilog Z80"
4+
5+
VIFileVersion ${VERSION}
6+
VIProductVersion ${VERSION}
7+
VIAddVersionKey "ProductName" ${NOMBRE}
8+
VIAddVersionKey "Comments" "${COMENTARIO}"
9+
VIAddVersionKey "CompanyName" "EyPC"
10+
VIAddVersionKey "LegalCopyright" "© EyPC"
11+
VIAddVersionKey "FileVersion" "${VERSION}"
12+
513
Name ${NOMBRE}
6-
OutFile "${NOMBRE_CORTO}.${VERSION}.exe"
14+
OutFile "dist/instalador/${NOMBRE_CORTO}_${VERSION}.exe"
715
InstallDir "$PROGRAMFILES64\${NOMBRE}"
816
InstallDirRegKey HKLM "Software\${NOMBRE_CORTO}" "Install_Dir"
917
RequestExecutionLevel admin
10-
#LicenseData "COPYING"
11-
#LicenseForceSelection radiobuttons "Acepto" "No acepto"
12-
13-
#!insertmacro MUI_LICENSEPAGE_RADIOBUTTONS
14-
15-
!insertmacro MUI_PAGE_WELCOME
16-
!insertmacro MUI_PAGE_LICENSE "COPYING"
17-
!insertmacro MUI_PAGE_DIRECTORY
18-
!insertmacro MUI_PAGE_INSTFILES
19-
!insertmacro MUI_PAGE_FINISH
20-
!insertmacro MUI_UNPAGE_WELCOME
21-
!insertmacro MUI_UNPAGE_CONFIRM
22-
!insertmacro MUI_UNPAGE_INSTFILES
23-
!insertmacro MUI_UNPAGE_FINISH
18+
LicenseData "COPYING"
19+
LicenseForceSelection radiobuttons "Acepto" "No acepto"
2420

25-
#Page license
26-
#Page directory
27-
#Page instfiles
28-
#UninstPage uninstConfirm
29-
#UninstPage instfiles
21+
Page license
22+
Page directory
23+
Page instfiles
24+
UninstPage uninstConfirm
25+
UninstPage instfiles
3026

3127
Section "Install"
3228
SetShellVarContext all
3329
SectionIn RO
3430
SetOutPath $INSTDIR
35-
File /oname=z80.exe "dist\z80\z80-win_x64.exe"
31+
File /oname=${NOMBRE_CORTO}.exe "dist\z80\z80-win_x64.exe"
3632
File "dist\z80\resources.neu"
3733
File "dist\z80\WebView2Loader.dll"
3834
File /oname=COPYING.txt "COPYING"
39-
# File "doc/*.*"
40-
WriteRegStr HKLM SOFTWARE\EmuladorZ80 "Install_Dir" "$INSTDIR"
35+
WriteRegStr HKLM SOFTWARE\${NOMBRE_CORTO} "Install_Dir" "$INSTDIR"
4136
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NOMBRE_CORTO}" "DisplayName" "${NOMBRE}"
4237
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NOMBRE_CORTO}" "UninstallString" '"$INSTDIR\uninstall.exe"'
4338
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NOMBRE_CORTO}" "NoModify" 1
4439
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NOMBRE_CORTO}" "NoRepair" 1
4540
WriteUninstaller "$INSTDIR\uninstall.exe"
46-
CreateShortcut "$SMPROGRAMS\${NOMBRE}.lnk" "$INSTDIR\z80.exe" "" "$INSTDIR\z80.exe" 0
47-
CreateShortcut "$DESKTOP\${NOMBRE}.lnk" "$INSTDIR\z80.exe" "" "$INSTDIR\z80.exe" 0
41+
CreateShortcut "$SMPROGRAMS\${NOMBRE}.lnk" "$INSTDIR\${NOMBRE_CORTO}.exe" "" "$INSTDIR\${NOMBRE_CORTO}.exe" 0
42+
CreateShortcut "$DESKTOP\${NOMBRE}.lnk" "$INSTDIR\${NOMBRE_CORTO}.exe" "" "$INSTDIR\${NOMBRE_CORTO}.exe" 0
4843
SectionEnd
4944

5045
Section "Uninstall"
@@ -55,8 +50,6 @@ Section "Uninstall"
5550
Delete $INSTDIR\WebView2Loader.dll
5651
Delete $INSTDIR\COPYING.txt
5752
Delete $INSTDIR\uninstall.exe
58-
# Delete "$INSTDIR\docs\*"
59-
Delete "$SMPROGRAMS\YOURPROGRAM\${NOMBRE}.lnk"
60-
# RMDir "$INSTDIR\docs"
53+
Delete "$SMPROGRAMS\${NOMBRE}.lnk"
6154
RMDir "$INSTDIR"
6255
SectionEnd

neutralino.config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/neutralinojs/neutralinojs/main/schemas/neutralino.config.schema.json",
33
"applicationId": "xyz.campanita.z80",
4-
"version": "1.0.0",
4+
"version": "1.0",
55
"defaultMode": "window",
66
"port": 0,
77
"documentRoot": "/public/",
@@ -20,7 +20,7 @@
2020
],
2121
"modes": {
2222
"window": {
23-
"title": "Emulador z80",
23+
"title": "RetroZ80Simulator",
2424
"width": 1200,
2525
"height": 700,
2626
"minWidth": 400,

preparar.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
set -o pipefail
3+
IFS=$'\n\t'
4+
5+
if [[ "dependencias" == "$1" || "todo" == "$1" ]]; then
6+
echo "* Comprobando dependencias..."
7+
makensis -VERSION > /dev/null
8+
if [[ 0 == "$?" ]]; then
9+
echo "nsis está instalado"
10+
else
11+
echo "nsis no está instalado"
12+
fi
13+
neu version > /dev/null
14+
if [[ 0 == "$?" ]]; then
15+
echo "neutralino está instalado"
16+
else
17+
echo "neutralino no está instalado"
18+
fi
19+
gcab --version > /dev/null
20+
if [[ 0 == "$?" ]]; then
21+
echo "gcab está instalado"
22+
else
23+
echo "gcab no está instalado"
24+
fi
25+
fi
26+
27+
if [[ "versionar" == "$1" || "todo" == "$1" ]]; then
28+
echo "* Modificando versión a $2..."
29+
sed -i -E "s/(.+<meta name=\"versionNumero\" content=\").*(\".+)/\1$2\2/" public/index.html
30+
sed -i -E "s/(.+<meta name=\"versionFecha\" content=\").*(\".+)/\1$(date --utc)\2/" public/index.html
31+
sed -i -E "s/(.+\"version\": \").*(\",)/\1$2\2/" neutralino.config.json
32+
fi
33+
34+
if [[ "compilar" == "$1" || "todo" == "$1" ]]; then
35+
echo "* Compilando..."
36+
neu build
37+
fi
38+
39+
if [[ "instalador" == "$1" || "todo" == "$1" ]]; then
40+
echo "* Generando instaladores..."
41+
mkdir -p dist/instalador
42+
echo "makensis instalador.nsi -DVERSION=$2"
43+
sed "3 a \!define VERSION $2" < instalador.nsi | makensis -
44+
fi
45+
46+
if [[ "portable" == "$1" || "todo" == "$1" ]]; then
47+
echo "* Generando portable..."
48+
mkdir -p dist/portable
49+
gcab -n -c dist/portable/z80_portable.cab dist/z80/z80-win_x64.exe dist/z80/resources.neu
50+
fi
51+
52+
if [[ "limpiar" == "$1" ]]; then
53+
echo "* Limpiando todo"
54+
rm -r dist/*
55+
fi

public/icon.png

240 KB
Loading

public/icon.svg

Lines changed: 0 additions & 102 deletions
This file was deleted.

public/index.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:l="https://campanita.xyz/ns/log" xml:lang="es" role="application">
44
<head>
55
<title>$nombre_app</title>
6-
<meta name="versionNumero" content="%%versionNumero%%" />
7-
<meta name="versionFecha" content="%%versionFecha%%" />
8-
<meta name="versionCommit" content="%%versionCommit%%" />
6+
<meta name="versionNumero" content="1.0" />
7+
<meta name="versionFecha" content="mié 14 jun 2023 13:25:39 UTC" />
98
<link rel="stylesheet" type="text/css" href="iconos.css" />
109
<link rel="stylesheet" type="text/css" href="estilos.css" />
1110
<link rel="stylesheet" type="text/css" href="hint.min.css" />
1211
<link rel="stylesheet" type="text/css" href="codemirror.min.css" />
13-
<link rel="stylesheet" type="text/css" href="monokai.min.css" />
14-
<link rel="icon" type="image/svg" href="icon.svg" />
12+
<link rel="icon" type="image/png" href="icon.png" />
1513
<link rel="manifest" href="manifest.json" />
1614
<script src="neutralino.js"></script>
1715
<script src="codemirror.min.js"></script>
@@ -625,13 +623,12 @@ <h2>$r_reg</h2>
625623
<dialog id="dlgAcercaDe" data-botones="a"><form method="dialog">
626624
<div id="dlgAcercaDeEsque">
627625
<figure>
628-
<img src="icon.svg" alt="$dlg_acercade_iconode" />
626+
<img src="icon.png" width="200" alt="$dlg_acercade_iconode" />
629627
<figcaption>$nombre_app</figcaption>
630628
</figure>
631629
<dl class="natural">
632630
<dt>$dlg_acercade_version</dt><dd>%version</dd>
633631
<dt>$dlg_acercade_fecha</dt><dd>%fecha</dd>
634-
<dt>$dlg_acercade_commit</dt><dd>%commit</dd>
635632
<dt>$dlg_acercade_sistema</dt><dd>%sistema</dd>
636633
<dt>Neutralino</dt><dd>%neu</dd>
637634
<dt>$dlg_acercade_ua</dt><dd>%ua</dd>

public/manifest.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
{
2-
"name": "Emulador Z80",
2+
"name": "RetroZ80Simulator",
33
"short_name": "Z80",
44
"start_url": ".",
55
"categories": [ "utilities", "development", "education" ],
66
"display": "standalone",
77
"background_color": "#fff",
8-
"description": "Emulador y ensamblador de un microprocesador Zilog Z80.",
8+
"description": "Ensamblador y emulador libre del microprocesador Zilog Z80.",
99
"orientation": "landscape",
1010
"icons": [
1111
{
1212
"src": "icon.png",
1313
"sizes": "64x64",
1414
"type": "image/png"
15-
},
16-
{
17-
"src": "icon.svg",
18-
"sizes": "any",
19-
"type": "image/svg"
2015
}
2116
]
2217
}

public/monokai.min.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)