Commit 55e27d24d133b19c9168a1ce5b70dc305e8eec42

Authored by Perry Werneck
1 parent 2ec66979
Exists in master and in 1 other branch develop

Creating windows package.

.gitignore
... ... @@ -18,3 +18,5 @@ dbus-glue.h
18 18 *.bak
19 19 *.[0-9]
20 20 vgcore.*
  21 +*.nsi
  22 +*.exe
... ...
configure.ac
... ... @@ -87,6 +87,18 @@ case "$host" in
87 87 AC_SUBST(WIN32_FILE_VERSION,$app_win32_file_version)
88 88  
89 89 AC_CONFIG_FILES(src/core/windows/resources.rc)
  90 + AC_CONFIG_FILES(win/hllapi.nsi)
  91 +
  92 + if test "$host_cpu" = "x86_64"; then
  93 + app_cv_programfiles="PROGRAMFILES64"
  94 + app_cv_winarch="64"
  95 + else
  96 + app_cv_programfiles="PROGRAMFILES"
  97 + app_cv_winarch="32"
  98 + fi
  99 +
  100 + AC_SUBST(PROGRAMFILES,$app_cv_programfiles)
  101 + AC_SUBST(WINARCH,$app_cv_winarch)
90 102 ;;
91 103  
92 104 *)
... ... @@ -108,6 +120,7 @@ AC_SUBST(LOGDIR)
108 120 AC_SUBST(DLLEXT)
109 121 AC_SUBST(DLLPREFIX)
110 122 AC_SUBST(LDFLAGS)
  123 +AC_SUBST(DLL_LDFLAGS)
111 124  
112 125 dnl ---------------------------------------------------------------------------
113 126 dnl Check for other programs
... ...
win/hllapi.nsi.in 0 → 100644
... ... @@ -0,0 +1,112 @@
  1 +!include "MUI2.nsh"
  2 +!include "x64.nsh"
  3 +!include "FileFunc.nsh"
  4 +
  5 +Name "@PACKAGE@"
  6 +Caption "@PACKAGE@ - @PACKAGE_DESCRIPTION@"
  7 +outfile "@PACKAGE@-@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.@PACKAGE_MINOR_RELEASE@-@host_cpu@.exe"
  8 +
  9 +XPStyle on
  10 +
  11 +installDir "$@PROGRAMFILES@\@PACKAGE@"
  12 +
  13 +# Get installation folder from registry if available
  14 +InstallDirRegKey HKLM "Software\@PACKAGE@" "InstallLocation"
  15 +
  16 +RequestExecutionLevel admin
  17 +
  18 +# Properties
  19 +VIProductVersion "@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.@PACKAGE_MINOR_RELEASE@"
  20 +VIFileVersion "@WIN32_VERSION@"
  21 +
  22 +VIAddVersionKey "ProductVersion" "@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.@PACKAGE_MINOR_RELEASE@"
  23 +VIAddVersionKey "FileVersion" "@WIN32_VERSION@"
  24 +
  25 +VIAddVersionKey "ProductName" "@PACKAGE_NAME@"
  26 +VIAddVersionKey "FileDescription" "@PACKAGE_DESCRIPTION@"
  27 +VIAddVersionKey "LegalCopyright" "GPL-2.0"
  28 +
  29 +# Interface
  30 +
  31 +!define MUI_ABORTWARNING
  32 +# !insertmacro MUI_PAGE_WELCOME
  33 +!insertmacro MUI_PAGE_LICENSE "..\LICENSE"
  34 +!insertmacro MUI_PAGE_COMPONENTS
  35 +!insertmacro MUI_PAGE_DIRECTORY
  36 +!insertmacro MUI_PAGE_INSTFILES
  37 +
  38 +# !insertmacro MUI_UNPAGE_WELCOME
  39 +!insertmacro MUI_UNPAGE_CONFIRM
  40 +!insertmacro MUI_UNPAGE_INSTFILES
  41 +# !insertmacro MUI_UNPAGE_FINISH
  42 +
  43 +# Languages
  44 +!insertmacro MUI_LANGUAGE "English"
  45 +
  46 +# Section scripts
  47 +!include Sections.nsh
  48 +
  49 +# default section
  50 +SubSection "@PACKAGE@" SecMain
  51 +
  52 + Section "Core" SecCore
  53 +
  54 + SetRegView @WINARCH@
  55 + ${DisableX64FSRedirection}
  56 +
  57 + # define the output path for this file
  58 + setOutPath $SYSDIR
  59 + SetShellVarContext all
  60 +
  61 + file "/oname=$SYSDIR\hllapi.dll" "..\.bin\Release\hllapi.dll"
  62 +
  63 + # define uninstaller name
  64 + SetRegView 32
  65 +
  66 + writeUninstaller $INSTDIR\uninstall.exe
  67 +
  68 + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
  69 + "DisplayName" "@PACKAGE@ - @PACKAGE_DESCRIPTION@"
  70 +
  71 + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
  72 + "DisplayVersion" "@PACKAGE_VERSION@"
  73 +
  74 + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
  75 + "UninstallString" "$INSTDIR\uninstall.exe"
  76 +
  77 + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
  78 + "InstallLocation" "$INSTDIR"
  79 +
  80 + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
  81 + "NoModify" "1"
  82 +
  83 + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
  84 + "NoRepair" "1"
  85 +
  86 + # Save instalation dir
  87 + WriteRegStr HKCU "Software\@PACKAGE@" "" $INSTDIR
  88 +
  89 + sectionEnd
  90 +
  91 +SubSectionEnd
  92 +
  93 +Section "Uninstall"
  94 +
  95 + # Always delete uninstaller first
  96 + delete $INSTDIR\uninstaller.exe
  97 +
  98 + # delete installed files
  99 + delete $SYSDIR\hllapi.dll
  100 +
  101 + # Remove registry
  102 + SetRegView 32
  103 + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@"
  104 + DeleteRegKey HKLM "Software\@PACKAGE@"
  105 +
  106 + SetRegView @WINARCH@
  107 + DeleteRegKey HKLM "Software\@PACKAGE@"
  108 +
  109 +SectionEnd
  110 +
  111 +
  112 +
... ...
win/pack.sh 0 → 100755
... ... @@ -0,0 +1,110 @@
  1 +#!/bin/bash
  2 +cd $(dirname $(dirname $(readlink -f $0)))
  3 +
  4 +PUBLISH=0
  5 +
  6 +pack() {
  7 +
  8 + echo -e "\e]2;hllapi-${1}\a"
  9 +
  10 + ./configure --cache=.${1}.cache \
  11 + --host=${1}-w64-mingw32 \
  12 + --prefix=/usr/${1}-w64-mingw32/sys-root/mingw \
  13 + --libdir=/usr/${1}-w64-mingw32/sys-root/mingw/lib
  14 +
  15 + if [ "$?" != "0" ]; then
  16 + exit -1
  17 + fi
  18 +
  19 + make clean
  20 + if [ "$?" != "0" ]; then
  21 + exit -1
  22 + fi
  23 +
  24 + make Release
  25 + if [ "$?" != "0" ]; then
  26 + exit -1
  27 + fi
  28 +
  29 + makensis win/hllapi.nsi
  30 +
  31 + if [ -d ~/public_html ]; then
  32 + mkdir -p ~/public_html/win
  33 + cp -v ./win/*.exe ~/public_html/win
  34 + if [ "$?" != "0" ]; then
  35 + exit -1
  36 + fi
  37 + fi
  38 +
  39 + if [ "${PUBLISH}" == "1" ] && [ ! -z ${WIN_PACKAGE_SERVER} ]; then
  40 + scp ./win/*.exe ${WIN_PACKAGE_SERVER}
  41 + if [ "$?" != "0" ]; then
  42 + exit -1
  43 + fi
  44 + fi
  45 +
  46 + rm -fr $TEMPDIR
  47 + rm -fr .${1}.cache
  48 +
  49 +}
  50 +
  51 +until [ -z "$1" ]
  52 +do
  53 + if [ ${1:0:2} = '--' ]; then
  54 + tmp=${1:2}
  55 + parameter=${tmp%%=*}
  56 + parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]")
  57 + value=${tmp##*=}
  58 +
  59 + case "$parameter" in
  60 + NOPUBLISH)
  61 + PUBLISH=0
  62 + ;;
  63 +
  64 + PUBLISH)
  65 + PUBLISH=1
  66 + ;;
  67 +
  68 + CLEAR)
  69 + if [ -d ~/public_html/win ]; then
  70 + rm -fr ~/public_html/win/hllapi-*-{i686,x86_64}.exe
  71 + fi
  72 +
  73 + ;;
  74 + HELP)
  75 + echo "${0} nome_da_matriz"
  76 + echo ""
  77 + echo "Opções:"
  78 + echo ""
  79 +
  80 + if [ ! -z ${WIN_PACKAGE_SERVER} ]; then
  81 + echo " --nopublish Don't publish in ${WIN_PACKAGE_SERVER}"
  82 + echo " --publish Publish in ${WIN_PACKAGE_SERVER}"
  83 + fi
  84 +
  85 +
  86 + if [ -d ~/public_html/win ]; then
  87 + echo " --clear Remove ~/public_html/win/hllapi-*-{i686,x86_64}.exe"
  88 + fi
  89 +
  90 + echo ""
  91 + exit 0
  92 +
  93 + ;;
  94 +
  95 + esac
  96 + fi
  97 +
  98 + shift
  99 +
  100 +done
  101 +
  102 +NOCONFIGURE=1 ./autogen.sh
  103 +if [ "$?" != "0" ]; then
  104 + exit -1
  105 +fi
  106 +
  107 +pack i686
  108 +pack x86_64
  109 +
  110 +
... ...