Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create installer #486

Merged
merged 3 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
GODOT_VERSION: 3.3
GODOT_VERSION_MAC: 3.3
EXPORT_NAME: Pixelorama
TAG: v0.8.3
TAG: v0.9
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}

jobs:
Expand All @@ -18,9 +18,9 @@ jobs:
container:
image: docker://barichello/godot-ci:3.3
steps:
- name: Setup WINE and rcedit 🍷
- name: Setup WINE, rcedit and NSIS 🍷
run: |
dpkg --add-architecture i386 && apt-get update && apt-get install -y wine-stable && apt-get install -y wine32
dpkg --add-architecture i386 && apt-get update && apt-get install -y wine-stable wine32 nsis
chown root:root -R ~
wget https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
mkdir -v -p ~/.local/share/rcedit
Expand All @@ -42,15 +42,19 @@ jobs:
godot -v --export "Windows Desktop 32-bit" ./build/windows-32bit/$EXPORT_NAME.exe
- name: Copy pixelorama_data folder 📁
run: |
cp -R ./pixelorama_data ./build/windows-64bit
rm ./build/windows-64bit/pixelorama_data/.gdignore
cp -R ./pixelorama_data ./build/windows-32bit
rm ./build/windows-32bit/pixelorama_data/.gdignore
cp -R ./pixelorama_data ./build
rm ./build/pixelorama_data/.gdignore
- name: Zip 🗜️
working-directory: ./build
run: |
cd build
zip -r windows-64bit.zip windows-64bit
zip -r windows-32bit.zip windows-32bit
zip windows-64bit.zip -rj windows-64bit && zip -r windows-64bit.zip pixelorama_data
zip windows-32bit.zip -rj windows-32bit && zip -r windows-32bit.zip pixelorama_data
- name: Build installer 🔧
run: |
python3 ./installer/utils/po2nsi.py -i ./installer/pixelorama.nsi -o ./installer/pixelorama_loc.nsi -p ./installer/po -l "English" -v
makensis ./installer/pixelorama_loc.nsi
mkdir ./build/installer
mv ./installer/${EXPORT_NAME}_${TAG}_setup.exe ./build/installer
- name: Upload 64-bit Release Asset 🚀
uses: svenstaro/upload-release-action@v2
with:
Expand All @@ -67,6 +71,13 @@ jobs:
asset_name: ${{env.EXPORT_NAME}}[Windows-32bit].zip
tag: ${{env.TAG}}
overwrite: true
- name: Upload installer Release Asset 🚀
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./build/installer/${{env.EXPORT_NAME}}_${{env.TAG}}_setup.exe
tag: ${{env.TAG}}
overwrite: true
- name: Upload Release Assets to itch.io 🎮
run: |
butler push ./build/windows-64bit ${{ secrets.ITCHIO_USERNAME }}/${{ secrets.ITCHIO_GAME }}:windows-64 --userversion ${{env.TAG}}
Expand Down
Binary file added assets/pxo.ico
Binary file not shown.
190 changes: 190 additions & 0 deletions installer/FileAssociation.nsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
/*
_____________________________________________________________________________

File Association
_____________________________________________________________________________

Based on code taken from http://nsis.sourceforge.net/File_Association

Usage in script:
1. !include "FileAssociation.nsh"
2. [Section|Function]
${FileAssociationFunction} "Param1" "Param2" "..." $var
[SectionEnd|FunctionEnd]

FileAssociationFunction=[RegisterExtension|UnRegisterExtension]

_____________________________________________________________________________

${RegisterExtension} "[executable]" "[extension]" "[description]"

"[executable]" ; executable which opens the file format
;
"[extension]" ; extension, which represents the file format to open
;
"[description]" ; description for the extension. This will be display in Windows Explorer.
;


${UnRegisterExtension} "[extension]" "[description]"

"[extension]" ; extension, which represents the file format to open
;
"[description]" ; description for the extension. This will be display in Windows Explorer.
;

_____________________________________________________________________________

Macros
_____________________________________________________________________________

Change log window verbosity (default: 3=no script)

Example:
!include "FileAssociation.nsh"
!insertmacro RegisterExtension
${FileAssociation_VERBOSE} 4 # all verbosity
!insertmacro UnRegisterExtension
${FileAssociation_VERBOSE} 3 # no script
*/


!ifndef FileAssociation_INCLUDED
!define FileAssociation_INCLUDED

!include Util.nsh

!verbose push
!verbose 3
!ifndef _FileAssociation_VERBOSE
!define _FileAssociation_VERBOSE 3
!endif
!verbose ${_FileAssociation_VERBOSE}
!define FileAssociation_VERBOSE `!insertmacro FileAssociation_VERBOSE`
!verbose pop

!macro FileAssociation_VERBOSE _VERBOSE
!verbose push
!verbose 3
!undef _FileAssociation_VERBOSE
!define _FileAssociation_VERBOSE ${_VERBOSE}
!verbose pop
!macroend



!macro RegisterExtensionCall _EXECUTABLE _EXTENSION _DESCRIPTION
!verbose push
!verbose ${_FileAssociation_VERBOSE}
Push `${_DESCRIPTION}`
Push `${_EXTENSION}`
Push `${_EXECUTABLE}`
${CallArtificialFunction} RegisterExtension_
!verbose pop
!macroend

!macro UnRegisterExtensionCall _EXTENSION _DESCRIPTION
!verbose push
!verbose ${_FileAssociation_VERBOSE}
Push `${_EXTENSION}`
Push `${_DESCRIPTION}`
${CallArtificialFunction} UnRegisterExtension_
!verbose pop
!macroend



!define RegisterExtension `!insertmacro RegisterExtensionCall`
!define un.RegisterExtension `!insertmacro RegisterExtensionCall`

!macro RegisterExtension
!macroend

!macro un.RegisterExtension
!macroend

!macro RegisterExtension_
!verbose push
!verbose ${_FileAssociation_VERBOSE}

Exch $R2 ;exe
Exch
Exch $R1 ;ext
Exch
Exch 2
Exch $R0 ;desc
Exch 2
Push $0
Push $1

ReadRegStr $1 HKCR $R1 "" ; read current file association
StrCmp "$1" "" NoBackup ; is it empty
StrCmp "$1" "$R0" NoBackup ; is it our own
WriteRegStr HKCR $R1 "backup_val" "$1" ; backup current value
NoBackup:
WriteRegStr HKCR $R1 "" "$R0" ; set our file association

ReadRegStr $0 HKCR $R0 ""
StrCmp $0 "" 0 Skip
WriteRegStr HKCR "$R0" "" "$R0"
WriteRegStr HKCR "$R0\shell" "" "open"
WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0"
Skip:
WriteRegStr HKCR "$R0\shell\open\command" "" '"$R2" "%1"'
WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0"
WriteRegStr HKCR "$R0\shell\edit\command" "" '"$R2" "%1"'

Pop $1
Pop $0
Pop $R2
Pop $R1
Pop $R0

!verbose pop
!macroend



!define UnRegisterExtension `!insertmacro UnRegisterExtensionCall`
!define un.UnRegisterExtension `!insertmacro UnRegisterExtensionCall`

!macro UnRegisterExtension
!macroend

!macro un.UnRegisterExtension
!macroend

!macro UnRegisterExtension_
!verbose push
!verbose ${_FileAssociation_VERBOSE}

Exch $R1 ;desc
Exch
Exch $R0 ;ext
Exch
Push $0
Push $1

ReadRegStr $1 HKCR $R0 ""
StrCmp $1 $R1 0 NoOwn ; only do this if we own it
ReadRegStr $1 HKCR $R0 "backup_val"
StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
DeleteRegKey HKCR $R0
Goto NoOwn

Restore:
WriteRegStr HKCR $R0 "" $1
DeleteRegValue HKCR $R0 "backup_val"
DeleteRegKey HKCR $R1 ;Delete key with association name settings

NoOwn:

Pop $1
Pop $0
Pop $R1
Pop $R0

!verbose pop
!macroend

!endif # !FileAssociation_INCLUDED
Empty file added installer/assets/.gdignore
Empty file.
28 changes: 14 additions & 14 deletions installer/installer.pot
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
#
#
msgid ""
msgstr ""
"Project-Id-Version: Pixelorama 0.8\n"
"Project-Id-Version: Pixelorama 0.9\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-08 22:43\n"
"POT-Creation-Date: 2021-05-07 04:44\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: \n"

#. SecInstall
#: .\pixelorama.nsi:72
#: ..\pixelorama.nsi:84
msgid "Install ${APPNAME}"
msgstr ""

#. SecStartmenu
#: .\pixelorama.nsi:73
#: ..\pixelorama.nsi:85
msgid "Create Start Menu shortcuts (optional)"
msgstr ""

#. SecDesktop
#: .\pixelorama.nsi:74
#: ..\pixelorama.nsi:86
msgid "Create shortcut on Desktop (optional)"
msgstr ""

#. un.SecUninstall
#: .\pixelorama.nsi:75
#: ..\pixelorama.nsi:87
msgid "Uninstall ${APPNAME} ${APPVERSION}"
msgstr ""

#. un.SecConfig
#: .\pixelorama.nsi:76
#: ..\pixelorama.nsi:88
msgid "Remove configuration files (optional)"
msgstr ""

#. DESC_SecInstall
#: .\pixelorama.nsi:178
#: ..\pixelorama.nsi:200
msgid "Installs ${APPNAME} ${APPVERSION}."
msgstr ""

#. DESC_SecStartmenu
#: .\pixelorama.nsi:179
#: ..\pixelorama.nsi:201
msgid "Creates Start Menu shortcuts for ${APPNAME}."
msgstr ""

#. DESC_SecDesktop
#: .\pixelorama.nsi:180
#: ..\pixelorama.nsi:202
msgid "Creates a Desktop shortcut for ${APPNAME}."
msgstr ""

#. DESC_un.SecUninstall
#: .\pixelorama.nsi:181
#: ..\pixelorama.nsi:203
msgid "Uninstalls ${APPNAME} ${APPVERSION} and removes all shortcuts."
msgstr ""

#. DESC_un.SecConfig
#: .\pixelorama.nsi:182
#: ..\pixelorama.nsi:204
msgid "Removes configuration files for ${APPNAME}."
msgstr ""
Loading