example 'cl-repl': add files to build Windows setup.exe

This commit is contained in:
pls.153 2023-12-01 17:27:57 +01:00
parent 4fe3e14181
commit a08d265e04
5 changed files with 46 additions and 3 deletions

View file

@ -47,7 +47,9 @@ macx: LIBS += -L../../../platforms/macos/lib
win32: LIBS += -L../../../platforms/windows/lib
win32 {
LIBS += -lws2_32
LIBS += -lws2_32
RC_ICONS = ../platforms/windows/icon.ico
include(../../src/windows.pri)
}

View file

@ -0,0 +1 @@
windeployqt.exe --release --qmldir ./qml setup/app.exe

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View file

@ -0,0 +1,40 @@
Unicode True
!include "MUI2.nsh"
Name "cl-repl"
OutFile "out\Setup-cl-repl-1.0.3.exe"
InstallDir $PROGRAMFILES\cl-repl
Var STARTMENU_FOLDER
!define MUI_ABORTWARNING
!define MUI_FINISHPAGE_RUN $INSTDIR\app.exe
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL
Section ""
SetShellVarContext all
SetOutPath $INSTDIR
File /r setup\*.*
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$DESKTOP\cl-repl.lnk" "$INSTDIR\app.exe"
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\cl-repl" "DisplayName" "cl-repl"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\cl-repl" "UninstallString" '"$INSTDIR\Uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\cl-repl" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\cl-repl" "NoRepair" 1
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
Section "Uninstall"
SetShellVarContext all
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\cl-repl"
RMDir /r /REBOOTOK "$INSTDIR"
RMDir /r "$SMPROGRAMS\cl-repl"
Delete "$DESKTOP\cl-repl.lnk"
Delete "$INSTDIR\Uninstall.exe"
SectionEnd
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd

View file

@ -7,8 +7,8 @@ import 'ext/dialogs' as Dlg
StackView {
id: main
objectName: "main"
width: Screen.desktopAvailableWidth
height: Screen.desktopAvailableHeight
width: 800 // alternatively: Screen.desktopAvailableWidth
height: 600 // alternatively: Screen.desktopAvailableHeight
initialItem: mainRect
Screen.orientationUpdateMask: Qt.LandscapeOrientation | Qt.PortraitOrientation | Qt.InvertedLandscapeOrientation