Skip to content

Commit

Permalink
Windows build changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikp123 committed Jul 19, 2019
1 parent 8d8fe05 commit 34cca56
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 22 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ if(MSYS OR MINGW OR MSVC)
else()
message(STATUS "GDI library not found")
endif()

if(CMAKE_BUILD_TYPE STREQUAL "Release")
message(STATUS "Since release build, console is being disabled")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS} -mwindows")
endif()
endif()

# alsa
Expand Down
4 changes: 2 additions & 2 deletions assets/desktop/xava.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Version=0.6.1
Name=XAVA visualizer
Version=0.6.2
Name=X.A.V.A. visualizer
Comment=Audio spectrum visualizer for Windows/macOS/Linux/BSD
Exec=xava
Icon=hdspmixer
Expand Down
78 changes: 58 additions & 20 deletions assets/nsis-win/xava.nsi
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
!include "MUI.nsh"
!include "MUI2.nsh"

# define name of installer
# Set project name
Name "X.A.V.A."

!define PRODUCT_VERSION "0.6.2.0"
!define VERSION "0.6.2.0"

VIProductVersion "${PRODUCT_VERSION}"
VIFileVersion "${VERSION}"
VIAddVersionKey "FileVersion" "${VERSION}"
VIAddVersionKey "LegalCopyright" "(C) Nikola Pavlica."
VIAddVersionKey "FileDescription" "Graphical audio visualizer"

# installer filename
OutFile "xava-win-installer.exe"

# define installation directory
InstallDir $PROGRAMFILES\xava
# installation directory
InstallDir $PROGRAMFILES64\xava

# For removing Start Menu shortcut in Windows 7
# Get admin priviledges
RequestExecutionLevel admin

# start default section
Expand All @@ -16,34 +28,60 @@ Section

# include these files
File xava.exe
File portaudio-list.exe
File README.txt
File README.md
File LICENSE.txt
File config.cfg
File *.dll

SetOutPath $APPDATA\xava\

File config

# create the uninstaller
WriteUninstaller "$INSTDIR\uninstall.exe"

# create a shortcut named "new shortcut" in the start menu programs directory
# point the new shortcut at the program uninstaller
CreateShortCut "$SMPROGRAMS\XAVA-G.lnk" "$INSTDIR\xava.exe"

Exec "$INSTDIR\portaudio-list.exe"
Exec "$WINDIR\notepad.exe $INSTDIR\README.txt"
CreateShortCut "$SMPROGRAMS\XAVA.lnk" "$INSTDIR\xava.exe"
CreateShortCut "$SMPROGRAMS\Uninstall XAVA.lnk" "$INSTDIR\uninstall.exe"
SectionEnd

# uninstaller section start
Section "uninstall"
# first, remove the link from the start menu
Delete "$SMPROGRAMS\XAVA.lnk"
Delete "$SMPROGRAMS\Uninstall XAVA.lnk"

# first, delete the uninstaller
Delete "$INSTDIR\uninstall.exe"

# second, remove the link from the start menu
Delete "$SMPROGRAMS\XAVA-G.lnk"

# second, delete the program
RMDir /r "$INSTDIR"
# uninstaller section end
SectionEnd


!ifndef EM_SETCUEBANNER
!define EM_SETCUEBANNER 0x1501 ; NT5 w/Themes & Vista+
!endif

!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_INSTFILESPAGE_NOAUTOCLOSE

!InsertMacro MUI_PAGE_LICENSE LICENSE.txt

!insertmacro MUI_PAGE_DIRECTORY

!insertmacro MUI_PAGE_INSTFILES

# Markdown files dont work for some reason, so we have to do it like this
Function OpenREADME
Exec 'notepad.exe "$INSTDIR\README.md"'
FunctionEnd

; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\xava.exe"
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION 'OpenREADME'
!define MUI_FINISHPAGE_LINK 'Check out the project page'
!define MUI_FINISHPAGE_LINK_LOCATION https://www.github.com/nikp123/xava
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English

0 comments on commit 34cca56

Please sign in to comment.