diff --git a/assets/installer.ico b/assets/installer.ico new file mode 100644 index 0000000..b4e6f82 Binary files /dev/null and b/assets/installer.ico differ diff --git a/assets/installer.xcf b/assets/installer.xcf new file mode 100644 index 0000000..96669f1 Binary files /dev/null and b/assets/installer.xcf differ diff --git a/assets/uninstaller.ico b/assets/uninstaller.ico new file mode 100644 index 0000000..24278c2 Binary files /dev/null and b/assets/uninstaller.ico differ diff --git a/bueno.bat b/bueno.bat index 6aa7e4e..3e2ab0d 100644 --- a/bueno.bat +++ b/bueno.bat @@ -1,3 +1,4 @@ taskkill /F /IM "qtest.exe" -qmake -o build\Makefile .\qtest.pro -mingw32-make.exe -C .\build -f Makefile +qmake -o build\Makefile .\qtest.pro +mingw32-make.exe -C .\build -f Makefile.Release +mingw32-make.exe -C .\build -f Makefile.Debug diff --git a/install/installer.nsi b/install/installer.nsi index b2e29eb..9181444 100644 --- a/install/installer.nsi +++ b/install/installer.nsi @@ -1,61 +1,121 @@ ;Auto versioning------------------------------- -!makensis "version.nsi" -!system "GetVersion.exe" -!include "Version.txt" -; optional cleanup -!delfile "GetVersion.exe" -!delfile "Version.txt" - -;Defines--------------- -;!define MULTIUSER_EXECUTIONLEVEL Highest - + !makensis "/DBUILDTYPE=$BUILDTYPE version.nsi" + !system "GetVersion.exe" + !include "Version.txt" + ;optional cleanup + !delfile "GetVersion.exe" + !delfile "Version.txt" ;Includes-------------------------------- !include "MUI2.nsh" !include "nsDialogs.nsh" !include "LogicLib.nsh" - ;!include "MultiUser.nsh" + !include "${NSISDIR}\Contrib\Language files\English.nsh" + !include "${NSISDIR}\Contrib\Language files\Spanish.nsh" + ;!include "${NSISDIR}\Contrib\Language files\English.nsh" + + +;Defines---------------------------------- + !define MUI_LANGDLL_ALLLANGUAGES + !define MUI_UNICON "..\assets\uninstaller.ico" + !define MUI_ICON "..\assets\installer.ico" + ;-------------------------------- ;General ;Name and file - Name "MixerQ" - OutFile "mixerq-installer-${version}.exe" - Unicode True + !if ${BUILDTYPE} == "release" + Name "MixerQ" + !else + Name "MixerQd" + !endif + OutFile "..\build\bin\MixerQ-installer-${version}.exe" - ;Default installation folder - ;InstallDir "$LOCALAPPDATA\Modern UI Test" - ;Get installation folder from registry if available ;InstallDirRegKey HKCU "Software\Modern UI Test" "" - + + Unicode True Var Is_Admin Var Install_Type ;Request application privileges for UAC. If admin is not available, only user-level install will be available RequestExecutionLevel highest +;-------------------------------- +;Interface Settings + + !define MUI_ABORTWARNING + +;-------------------------------- +;Pages + !insertmacro MUI_PAGE_WELCOME + !insertmacro MUI_PAGE_LICENSE "..\LICENSE.txt" + ;!insertmacro MULTIUSER_PAGE_INSTALLMODE + Page Custom InstallTargetPage + ;!insertmacro MUI_PAGE_COMPONENTS + !define MUI_PAGE_CUSTOMFUNCTION_PRE Skip_Directory_Func + !insertmacro MUI_PAGE_DIRECTORY + !insertmacro MUI_PAGE_INSTFILES + !insertmacro MUI_PAGE_FINISH + + !insertmacro MUI_UNPAGE_WELCOME + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES + !insertmacro MUI_UNPAGE_FINISH + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + !insertmacro MUI_LANGUAGE "Spanish" + !insertmacro MUI_LANGUAGE "SpanishInternational" + + ;English---------------------------- + LangString Header_Title ${LANG_ENGLISH} "Configure Install" + LangString Header_Subtitle ${LANG_ENGLISH} "Customize install settings" + LangString Option_Scope ${LANG_ENGLISH} "Select for whom will $(^Name) be installed: " + LangString Scope_Machine ${LANG_ENGLISH} "All users" + LangString Scope_User ${LANG_ENGLISH} "Current user" + + ;Spanish/SpanishInternational---------------------------- + LangString Header_Title ${LANG_SPANISH} "Configurar instalación" + LangString Header_Subtitle ${LANG_SPANISH} "Elija los ajustes de la instalación" + LangString Option_Scope ${LANG_SPANISH} "$(^Name) será instalado para: " + LangString Scope_Machine ${LANG_SPANISH} "Todos los usuarios" + LangString Scope_User ${LANG_SPANISH} "Usuario actual" + + LangString Header_Title ${LANG_SPANISHINTERNATIONAL} "Configurar instalación" + LangString Header_Subtitle ${LANG_SPANISHINTERNATIONAL} "Elija los ajustes de la instalación" + LangString Option_Scope ${LANG_SPANISHINTERNATIONAL} "$(^Name) será instalado para: " + LangString Scope_Machine ${LANG_SPANISHINTERNATIONAL} "Todos los usuarios" + LangString Scope_User ${LANG_SPANISHINTERNATIONAL} "Usuario actual" + +;Functions------------------------------ + Function Skip_Directory_Func + ;StrCmp $Install_Type "user" dontSkip + Abort # skip the page + ;dontSkip: + FunctionEnd !macro ONINIT un Function ${un}.onInit ; The value of SetShellVarContext detetmines whether SHCTX is HKLM or HKCU - ; and whether SMPROGRAMS refers to all users or just the current user + ; and whether SMPROGRAMS refers to all users or just the current + !insertmacro MUI_LANGDLL_DISPLAY UserInfo::GetAccountType Pop $0 ${If} $0 == "Admin" ; If we're an admin, default to installing to C:\Program Files - ;SetShellVarContext all - ;StrCpy $INSTDIR_BASE "$PROGRAMFILES64" + SetShellVarContext all + ; StrCpy $INSTDIR "$PROGRAMFILES64\$(^Name)" StrCpy $Is_Admin "true" - StrCpy $Install_Type "machine" ${Else} ; If we're just a user, default to installing to ~\AppData\Local - ;SetShellVarContext current - ;StrCpy $INSTDIR_BASE "$LOCALAPPDATA" + SetShellVarContext current + ; StrCpy $INSTDIR "$LOCALAPPDATA\$(^Name)" StrCpy $Is_Admin "false" - StrCpy $Install_Type "user" ${EndIf} ; ${If} $INSTDIR == "" @@ -75,56 +135,35 @@ !insertmacro ONINIT "" !insertmacro ONINIT "un" -;-------------------------------- -;Interface Settings - - !define MUI_ABORTWARNING - -;-------------------------------- -;Pages - - !insertmacro MUI_PAGE_WELCOME - !insertmacro MUI_PAGE_LICENSE "..\LICENSE.txt" - ;!insertmacro MULTIUSER_PAGE_INSTALLMODE - Page Custom InstallTargetPage - ;!insertmacro MUI_PAGE_COMPONENTS - !insertmacro MUI_PAGE_DIRECTORY - !insertmacro MUI_PAGE_INSTFILES - !insertmacro MUI_PAGE_FINISH - - !insertmacro MUI_UNPAGE_WELCOME - !insertmacro MUI_UNPAGE_CONFIRM - !insertmacro MUI_UNPAGE_INSTFILES - !insertmacro MUI_UNPAGE_FINISH - -;-------------------------------- -;Languages - - !insertmacro MUI_LANGUAGE "English" - ;NSDialog InstallTarget Page definition--------------------------------- Function InstallTargetPage - !insertmacro MUI_HEADER_TEXT "Configure Install" "Customize install settings" - + !insertmacro MUI_HEADER_TEXT $(Header_Title) $(Header_Subtitle) + ;MessageBox MB_OK "Install type $Install_Type" + ;MessageBox MB_OK "Build type ${BUILDTYPE}" nsDialogs::Create 1018 Pop $0 - ${NSD_CreateLabel} 0 0 100% 10% "Select for whom will $(^Name) be installed: " + FindWindow $0 "#32770" + GetDlgItem $1 $0 1 ;next/install button + SendMessage $1 ${WM_SETTEXT} 1 "STR:$(^InstallBtn)" + Pop $0 + + ${NSD_CreateLabel} 0 0 100% 10% $(Option_Scope) Pop $3 - ${NSD_CreateFirstRadioButton} 0 12% 40% 6% "All users" + ${NSD_CreateFirstRadioButton} 0 12% 40% 6% $(Scope_Machine) Pop $1 ${If} $Is_Admin == "false" EnableWindow $1 0 StrCpy $INSTDIR "$LOCALAPPDATA\$(^Name)" ${Else} SendMessage $1 ${BM_CLICK} "" "" ;Set default - StrCpy $INSTDIR "$PROGRAMFILES64\$(^Name)" + StrCpy $INSTDIR "$PROGRAMFILES64\$(^Name)" ${EndIf} ${NSD_OnClick} $1 All_Users_Click - ${NSD_CreateAdditionalRadioButton} 0 24% 40% 6% "Current user" + ${NSD_CreateAdditionalRadioButton} 0 24% 40% 6% $(Scope_User) Pop $2 ${IfThen} $Is_Admin == "false" ${|} SendMessage $2 ${BM_CLICK} "" "" ${|} ${NSD_OnClick} $2 Current_User_Click @@ -134,16 +173,24 @@ FunctionEnd Function All_Users_Click Pop $0 - StrCpy $INSTDIR "$PROGRAMFILES64\$(^Name)" - StrCpy $Install_Type "machine" + SetShellVarContext all + StrCpy $INSTDIR "$PROGRAMFILES64\$(^Name)" + StrCpy $Install_Type "machine" ;${NSD_SetText} $0 "machine" + ;FindWindow $0 "#32770" + ;GetDlgItem $1 $0 1 ;next/install button + ;SendMessage $1 ${WM_SETTEXT} 1 "STR:$(^InstallBtn)" FunctionEnd Function Current_User_Click Pop $0 + SetShellVarContext current StrCpy $INSTDIR "$LOCALAPPDATA\$(^Name)" - StrCpy $Install_Type "user" + StrCpy $Install_Type "user" ;${NSD_SetText} $0 "user" + ;FindWindow $0 "#32770" + ;GetDlgItem $1 $0 1 ;next/install button + ;SendMessage $1 ${WM_SETTEXT} 1 "STR:$(^NextBtn)" FunctionEnd ;Default section---------------------- @@ -151,27 +198,27 @@ Section SetRegView 64 SetOutPath $INSTDIR - ;File "..\build\debug\qtest.exe" + !if ${BUILDTYPE} == "release" + File "..\build\bin\MixerQ.exe" + !else + File "..\build\bin\MixerQd.exe" + !endif File "..\LICENSE.txt" + ;Start menu shortcut + createDirectory "$SMPROGRAMS\$(^Name)" + createShortCut "$SMPROGRAMS\$(^Name)\$(^Name).lnk" "$INSTDIR\$(^Name).exe" + createShortCut "$SMPROGRAMS\$(^Name)\Uninstall$(^Name).lnk" "$INSTDIR\Uninstall$(^Name).exe" + ;Store installation folder - - ${If} $Install_Type == "user" - WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "DisplayName" "$(^Name)" - WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "UninstallString" '"$INSTDIR\Uninstall.exe"' - WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "NoModify" 1 - WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "NoRepair" 1 - WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name)" "$INSTDIR\$(^Name)" - ${Else} - WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "DisplayName" "$(^Name)" - WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "UninstallString" '"$INSTDIR\Uninstall.exe"' - WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "NoModify" 1 - WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "NoRepair" 1 - WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name)" "$INSTDIR\$(^Name)" - ${EndIf} + WriteRegStr SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "DisplayName" "$(^Name)" + WriteRegStr SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "UninstallString" '"$INSTDIR\Uninstall$(^Name).exe"' + WriteRegDWORD SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "NoModify" 1 + WriteRegDWORD SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "NoRepair" 1 + WriteRegStr SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name)" "$INSTDIR\$(^Name)" ;Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" + WriteUninstaller "$INSTDIR\Uninstall$(^Name).exe" SectionEnd @@ -191,20 +238,28 @@ SectionEnd ;Uninstaller Section Section "Uninstall" - SetRegView 64 - ;ADD YOUR OWN FILES HERE... - Delete "$INSTDIR\qtest.exe" - Delete "$INSTDIR\LICENSE.txt" - Delete "$INSTDIR\Uninstall.exe" -;!define PRODUCT_UNINST_ROOT_KEY "HKLM" - RMDir "$INSTDIR" + SetRegView 64 + + SetShellVarContext current + DeleteRegValue HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name)" + DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" + Delete "$SMPROGRAMS\$(^Name)\$(^Name).lnk" + Delete "$SMPROGRAMS\$(^Name)\Uninstall$(^Name).lnk" + RMDir "$SMPROGRAMS\$(^Name)" - ${If} $Install_Type == "user" - DeleteRegValue HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name)" - DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" - ${Else} + ${If} $Is_Admin == "true" + SetShellVarContext all DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name)" DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" + Delete "$SMPROGRAMS\$(^Name)\$(^Name).lnk" + Delete "$SMPROGRAMS\$(^Name)\Uninstall$(^Name).lnk" + RMDir "$SMPROGRAMS\$(^Name)" ${EndIf} - + + Delete "$INSTDIR\$(^Name).exe" + Delete "$INSTDIR\LICENSE.txt" + Delete "$INSTDIR\Uninstall$(^Name).exe" + ;!define PRODUCT_UNINST_ROOT_KEY "HKLM" + RMDir "$INSTDIR" + SectionEnd diff --git a/install/version.nsi b/install/version.nsi index 6f5ac83..5e85c8c 100644 --- a/install/version.nsi +++ b/install/version.nsi @@ -1,4 +1,8 @@ -!define File "..\build\debug\qtest.exe" +!if ${BUILDTYPE} == "release" + !define File "..\build\bin\MixerQ.exe" +!else + !define File "..\build\bin\MixerQd.exe" +!endif OutFile "GetVersion.exe" SilentInstall silent diff --git a/qtest.pro b/qtest.pro index be04829..0568bca 100644 --- a/qtest.pro +++ b/qtest.pro @@ -1,18 +1,28 @@ -QMAKE_CXXFLAGS += --target=x86_64-w64-mingw32 -g -gcodeview -O0 -Werror=return-type -QMAKE_LFLAGS += --target=x86_64-w64-mingw32 -g -Wl,-pdb= -v -LIBS += -LC:/capybara/libclang/x86_64-w64-mingw32/lib -lWinmm -lodbc32 -lodbccp32 -luuid -loleaut32 -lole32 -lshell32 -ladvapi32 -lcomdlg32 -lwinspool -lgdi32 -luser32 -lkernel32 -lpropsys -static -stdlib=libc++ -lunwind -#"kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" -luuid -loleaut32 -lole32 -lshell32 -ladvapi32 -lcomdlg32 -lwinspool -lgdi32 -luser32 -lkernel32 -DEFINES += DEBUG QT_LOGGING_TO_CONSOLE=1 WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0602 -CONFIG += debug +TEMPLATE = app +QMAKE_CXXFLAGS += --target=x86_64-w64-mingw32 -Werror=return-type +QMAKE_LFLAGS += --target=x86_64-w64-mingw32 -v +CONFIG(release, debug|release) { + TARGET = MixerQ + DESTDIR = bin + VERSION = 0.9.0.0 + #QMAKE_CXXFLAGS += -O2 < Default. Modifying requires removing. +} else { + TARGET = MixerQd + DESTDIR = bin + VERSION = 0.9.0.1 + QMAKE_CXXFLAGS += -g -gcodeview -O0 + QMAKE_LFLAGS += -g -Wl,-pdb= +} + +LIBS += -lWinmm -lodbc32 -lodbccp32 -luuid -loleaut32 -lole32 -lshell32 -ladvapi32 -lcomdlg32 -lwinspool -lgdi32 -luser32 -lkernel32 -lpropsys -static -stdlib=libc++ -lunwind +DEFINES += QT_LOGGING_TO_CONSOLE=1 WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0602 +DEFINES_DEBUG += DEBUG QT += widgets network INCLUDEPATH += "$$PWD\src" "$$PWD\src\qt" "$$PWD\src\back" "$$PWD\src\back\reimpl" "$$PWD\src\cont" -DESTPATH += "$$PWD\src" "$$PWD\src\qt" "$$PWD\src\back" "$$PWD\src\back\reimpl" "$$PWD\src\cont" -VPATH += "$$PWD\src" "$$PWD\src\qt" "$$PWD\src\back" "$$PWD\src\back\reimpl" "$$PWD\src\cont" +VPATH += "$$PWD\src" "$$PWD\src\qt" "$$PWD\src\back" "$$PWD\src\back\reimpl" "$$PWD\src\cont" SOURCES += qtestmain.cpp qtclasses.cpp backlasses.cpp backsessionclasses.cpp contclasses.cpp contsessionclasses.cpp settings.cpp HEADERS += qtclasses.h backlasses.h backsessionclasses.h contclasses.h contsessionclasses.h global.h debug.h backfuncs.h ipolicyconfig.h msinclude.h meterslider.h qtvisuals.h settings.h RESOURCES = assets.qrc RC_ICONS += assets/logo.ico - -#DESTDIR += "build"