installer done, recipe cleanup

This commit is contained in:
Hane 2025-01-12 23:16:36 +01:00
commit cdde1ce9b8
7 changed files with 173 additions and 103 deletions

BIN
assets/installer.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

BIN
assets/installer.xcf Normal file

Binary file not shown.

BIN
assets/uninstaller.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

View file

@ -1,3 +1,4 @@
taskkill /F /IM "qtest.exe" taskkill /F /IM "qtest.exe"
qmake -o build\Makefile .\qtest.pro qmake -o build\Makefile .\qtest.pro
mingw32-make.exe -C .\build -f Makefile mingw32-make.exe -C .\build -f Makefile.Release
mingw32-make.exe -C .\build -f Makefile.Debug

View file

@ -1,61 +1,121 @@
;Auto versioning------------------------------- ;Auto versioning-------------------------------
!makensis "version.nsi" !makensis "/DBUILDTYPE=$BUILDTYPE version.nsi"
!system "GetVersion.exe" !system "GetVersion.exe"
!include "Version.txt" !include "Version.txt"
; optional cleanup ;optional cleanup
!delfile "GetVersion.exe" !delfile "GetVersion.exe"
!delfile "Version.txt" !delfile "Version.txt"
;Defines---------------
;!define MULTIUSER_EXECUTIONLEVEL Highest
;Includes-------------------------------- ;Includes--------------------------------
!include "MUI2.nsh" !include "MUI2.nsh"
!include "nsDialogs.nsh" !include "nsDialogs.nsh"
!include "LogicLib.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 ;General
;Name and file ;Name and file
Name "MixerQ" !if ${BUILDTYPE} == "release"
OutFile "mixerq-installer-${version}.exe" Name "MixerQ"
Unicode True !else
Name "MixerQd"
;Default installation folder !endif
;InstallDir "$LOCALAPPDATA\Modern UI Test" OutFile "..\build\bin\MixerQ-installer-${version}.exe"
;Get installation folder from registry if available ;Get installation folder from registry if available
;InstallDirRegKey HKCU "Software\Modern UI Test" "" ;InstallDirRegKey HKCU "Software\Modern UI Test" ""
Unicode True
Var Is_Admin Var Is_Admin
Var Install_Type Var Install_Type
;Request application privileges for UAC. If admin is not available, only user-level install will be available ;Request application privileges for UAC. If admin is not available, only user-level install will be available
RequestExecutionLevel highest 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 !macro ONINIT un
Function ${un}.onInit Function ${un}.onInit
; The value of SetShellVarContext detetmines whether SHCTX is HKLM or HKCU ; 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 UserInfo::GetAccountType
Pop $0 Pop $0
${If} $0 == "Admin" ${If} $0 == "Admin"
; If we're an admin, default to installing to C:\Program Files ; If we're an admin, default to installing to C:\Program Files
;SetShellVarContext all SetShellVarContext all
;StrCpy $INSTDIR_BASE "$PROGRAMFILES64" ; StrCpy $INSTDIR "$PROGRAMFILES64\$(^Name)"
StrCpy $Is_Admin "true" StrCpy $Is_Admin "true"
StrCpy $Install_Type "machine"
${Else} ${Else}
; If we're just a user, default to installing to ~\AppData\Local ; If we're just a user, default to installing to ~\AppData\Local
;SetShellVarContext current SetShellVarContext current
;StrCpy $INSTDIR_BASE "$LOCALAPPDATA" ; StrCpy $INSTDIR "$LOCALAPPDATA\$(^Name)"
StrCpy $Is_Admin "false" StrCpy $Is_Admin "false"
StrCpy $Install_Type "user"
${EndIf} ${EndIf}
; ${If} $INSTDIR == "" ; ${If} $INSTDIR == ""
@ -75,45 +135,24 @@
!insertmacro ONINIT "" !insertmacro ONINIT ""
!insertmacro ONINIT "un" !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--------------------------------- ;NSDialog InstallTarget Page definition---------------------------------
Function InstallTargetPage 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 nsDialogs::Create 1018
Pop $0 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 Pop $3
${NSD_CreateFirstRadioButton} 0 12% 40% 6% "All users" ${NSD_CreateFirstRadioButton} 0 12% 40% 6% $(Scope_Machine)
Pop $1 Pop $1
${If} $Is_Admin == "false" ${If} $Is_Admin == "false"
EnableWindow $1 0 EnableWindow $1 0
@ -124,7 +163,7 @@ Function InstallTargetPage
${EndIf} ${EndIf}
${NSD_OnClick} $1 All_Users_Click ${NSD_OnClick} $1 All_Users_Click
${NSD_CreateAdditionalRadioButton} 0 24% 40% 6% "Current user" ${NSD_CreateAdditionalRadioButton} 0 24% 40% 6% $(Scope_User)
Pop $2 Pop $2
${IfThen} $Is_Admin == "false" ${|} SendMessage $2 ${BM_CLICK} "" "" ${|} ${IfThen} $Is_Admin == "false" ${|} SendMessage $2 ${BM_CLICK} "" "" ${|}
${NSD_OnClick} $2 Current_User_Click ${NSD_OnClick} $2 Current_User_Click
@ -134,16 +173,24 @@ FunctionEnd
Function All_Users_Click Function All_Users_Click
Pop $0 Pop $0
SetShellVarContext all
StrCpy $INSTDIR "$PROGRAMFILES64\$(^Name)" StrCpy $INSTDIR "$PROGRAMFILES64\$(^Name)"
StrCpy $Install_Type "machine" StrCpy $Install_Type "machine"
;${NSD_SetText} $0 "machine" ;${NSD_SetText} $0 "machine"
;FindWindow $0 "#32770"
;GetDlgItem $1 $0 1 ;next/install button
;SendMessage $1 ${WM_SETTEXT} 1 "STR:$(^InstallBtn)"
FunctionEnd FunctionEnd
Function Current_User_Click Function Current_User_Click
Pop $0 Pop $0
SetShellVarContext current
StrCpy $INSTDIR "$LOCALAPPDATA\$(^Name)" StrCpy $INSTDIR "$LOCALAPPDATA\$(^Name)"
StrCpy $Install_Type "user" StrCpy $Install_Type "user"
;${NSD_SetText} $0 "user" ;${NSD_SetText} $0 "user"
;FindWindow $0 "#32770"
;GetDlgItem $1 $0 1 ;next/install button
;SendMessage $1 ${WM_SETTEXT} 1 "STR:$(^NextBtn)"
FunctionEnd FunctionEnd
;Default section---------------------- ;Default section----------------------
@ -151,27 +198,27 @@ Section
SetRegView 64 SetRegView 64
SetOutPath $INSTDIR 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" File "..\LICENSE.txt"
;Store installation folder ;Start menu shortcut
createDirectory "$SMPROGRAMS\$(^Name)"
createShortCut "$SMPROGRAMS\$(^Name)\$(^Name).lnk" "$INSTDIR\$(^Name).exe"
createShortCut "$SMPROGRAMS\$(^Name)\Uninstall$(^Name).lnk" "$INSTDIR\Uninstall$(^Name).exe"
${If} $Install_Type == "user" ;Store installation folder
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "DisplayName" "$(^Name)" WriteRegStr SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "DisplayName" "$(^Name)"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "UninstallString" '"$INSTDIR\Uninstall.exe"' WriteRegStr SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "UninstallString" '"$INSTDIR\Uninstall$(^Name).exe"'
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "NoModify" 1 WriteRegDWORD SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "NoModify" 1
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "NoRepair" 1 WriteRegDWORD SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "NoRepair" 1
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name)" "$INSTDIR\$(^Name)" WriteRegStr SHCTX "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}
;Create uninstaller ;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe" WriteUninstaller "$INSTDIR\Uninstall$(^Name).exe"
SectionEnd SectionEnd
@ -192,19 +239,27 @@ SectionEnd
Section "Uninstall" Section "Uninstall"
SetRegView 64 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"
${If} $Install_Type == "user" SetShellVarContext current
DeleteRegValue HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name)" DeleteRegValue HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name)"
DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
${Else} Delete "$SMPROGRAMS\$(^Name)\$(^Name).lnk"
Delete "$SMPROGRAMS\$(^Name)\Uninstall$(^Name).lnk"
RMDir "$SMPROGRAMS\$(^Name)"
${If} $Is_Admin == "true"
SetShellVarContext all
DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name)" DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name)"
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
Delete "$SMPROGRAMS\$(^Name)\$(^Name).lnk"
Delete "$SMPROGRAMS\$(^Name)\Uninstall$(^Name).lnk"
RMDir "$SMPROGRAMS\$(^Name)"
${EndIf} ${EndIf}
Delete "$INSTDIR\$(^Name).exe"
Delete "$INSTDIR\LICENSE.txt"
Delete "$INSTDIR\Uninstall$(^Name).exe"
;!define PRODUCT_UNINST_ROOT_KEY "HKLM"
RMDir "$INSTDIR"
SectionEnd SectionEnd

View file

@ -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" OutFile "GetVersion.exe"
SilentInstall silent SilentInstall silent

View file

@ -1,18 +1,28 @@
QMAKE_CXXFLAGS += --target=x86_64-w64-mingw32 -g -gcodeview -O0 -Werror=return-type TEMPLATE = app
QMAKE_LFLAGS += --target=x86_64-w64-mingw32 -g -Wl,-pdb= -v QMAKE_CXXFLAGS += --target=x86_64-w64-mingw32 -Werror=return-type
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 QMAKE_LFLAGS += --target=x86_64-w64-mingw32 -v
#"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 CONFIG(release, debug|release) {
DEFINES += DEBUG QT_LOGGING_TO_CONSOLE=1 WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0602 TARGET = MixerQ
CONFIG += debug 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 QT += widgets network
INCLUDEPATH += "$$PWD\src" "$$PWD\src\qt" "$$PWD\src\back" "$$PWD\src\back\reimpl" "$$PWD\src\cont" 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 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 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 RESOURCES = assets.qrc
RC_ICONS += assets/logo.ico RC_ICONS += assets/logo.ico
#DESTDIR += "build"