Sync edgetx to Gitea

This commit is contained in:
2026-08-03 16:37:20 +08:00
commit 14eb5a3fb9
5364 changed files with 2835009 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
Copyright © 2011-2019 OpenTX team
Copyright © 2021-@BUILD_YEAR@ EdgeTX team
EdgeTX Companion is based on code:
- named eePe by author - Erez Raviv <erezraviv@gmail.com>
- named OpenTX Companion - https://github.com/opentx/opentx
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any distribution.
+52
View File
@@ -0,0 +1,52 @@
#!/bin/bash
# ARGV0 is what the AppImage was called as (includes symlink name)
# APPDIR is set by AppImage runtime to the mount point
CALLED_AS="$(basename "${ARGV0}")"
CALLED_AS_LOWER="${CALLED_AS,,}" # converts to lowercase
# Check if called via symlink with "simulator" in name
if [[ "$CALLED_AS_LOWER" == *"simulator"* ]]; then
exec "${APPDIR}/usr/bin/@SIMULATOR_NAME@" "$@"
fi
# Check for command-line parameter
case "$1" in
--simulator)
shift
exec "${APPDIR}/usr/bin/@SIMULATOR_NAME@" "$@"
;;
--help)
echo "EdgeTX Companion @VERSION@ AppImage"
echo ""
echo "AppImage Options:"
echo " --simulator Launch Simulator instead"
echo " --apprun-help Show AppImage routing help"
echo ""
echo "Companion Help:"
exec "${APPDIR}/usr/bin/@COMPANION_NAME@" --help
;;
--apprun-help)
echo "EdgeTX Companion AppImage Usage: $0 [OPTIONS]"
echo ""
echo "Routing Options:"
echo " (no options) Launch Companion"
echo " --simulator Launch Simulator"
echo " --help Show Companion help (with AppImage options)"
echo " --apprun-help Show this AppImage routing help only"
echo ""
echo "Symlink Usage:"
echo " Create a symlink with 'simulator' in the name to launch Simulator:"
echo " ln -s @COMPANION_NAME@.AppImage @SIMULATOR_NAME@.AppImage"
echo " ./@SIMULATOR_NAME@.AppImage"
echo ""
echo "Examples:"
echo " $0 # Launch Companion"
echo " $0 --simulator # Launch Simulator"
echo " $0 --simulator --help # Show Simulator help"
exit 0
;;
*)
exec "${APPDIR}/usr/bin/@COMPANION_NAME@" "$@"
;;
esac
@@ -0,0 +1,8 @@
execute_process(COMMAND @CMAKE_MAKE_PROGRAM@ DESTDIR=@APPIMAGE_DIR@ install
WORKING_DIRECTORY @CMAKE_BINARY_DIR@)
# This is done by cmake install target
# setup Companion application
# add -v0 to linuxdeploy for debug info
execute_process(COMMAND env LDAI_NO_APPSTREAM=1 @LINUXDEPLOY_APP@ --appdir @APPIMAGE_DIR@ -e @COMPANION_NAME@ -e @SIMULATOR_NAME@ -d @COMPANION_DESKTOP_FILE@ --custom-apprun @CMAKE_BINARY_DIR@/AppDir/AppRun --plugin qt --output appimage
WORKING_DIRECTORY @CMAKE_BINARY_DIR@)
@@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Name=EdgeTX Companion @VERSION@
GenericName=Transmitter Companion App
Comment=The Ultimate Transmitter Companion
Icon=@COMPANION_NAME@
Exec=@COMPANION_NAME@
Terminal=false
StartupWMClass=EdgeTX Companion
StartupNotify=false
Categories=Utility;
@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Name=EdgeTX Simulator @VERSION@
GenericName=Transmitter Simulator App
Comment=The Ultimate Transmitter Simulator
Icon=@COMPANION_NAME@
Exec=@COMPANION_NAME@ --simulator
Terminal=false
StartupNotify=false
Categories=Utility;
Binary file not shown.
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSRequiresAquaSystemAppearance</key>
<true/>
<!-- added since cmake/qt do not add these by default -->
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
</dict>
</plist>
+59
View File
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBClasses</key>
<array>
<dict>
<key>ACTIONS</key>
<dict>
<key>hide</key>
<string>id</string>
<key>hideOtherApplications</key>
<string>id</string>
<key>orderFrontStandardAboutPanel</key>
<string>id</string>
<key>qtDispatcherToQAction</key>
<string>id</string>
<key>terminate</key>
<string>id</string>
<key>unhideAllApplications</key>
<string>id</string>
</dict>
<key>CLASS</key>
<string>QCocoaMenuLoader</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>OUTLETS</key>
<dict>
<key>aboutItem</key>
<string>NSMenuItem</string>
<key>aboutQtItem</key>
<string>NSMenuItem</string>
<key>appMenu</key>
<string>NSMenu</string>
<key>hideItem</key>
<string>NSMenuItem</string>
<key>preferencesItem</key>
<string>NSMenuItem</string>
<key>quitItem</key>
<string>NSMenuItem</string>
<key>theMenu</key>
<string>NSMenu</string>
</dict>
<key>SUPERCLASS</key>
<string>NSResponder</string>
</dict>
<dict>
<key>CLASS</key>
<string>FirstResponder</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSObject</string>
</dict>
</array>
<key>IBVersion</key>
<string>1</string>
</dict>
</plist>
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
<string>672</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>57</integer>
</array>
<key>IBSystem Version</key>
<string>9L31a</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
</plist>
Binary file not shown.
@@ -0,0 +1,190 @@
/*
_____________________________________________________________________________
File Association
_____________________________________________________________________________
Based on code taken from http://nsis.sourceforge.net/File_Association
Usage in script:
1. !include "FileAssociation.nsh"
2. [Section|Function]
${FileAssociationFunction} "Param1" "Param2" "..." $var
[SectionEnd|FunctionEnd]
FileAssociationFunction=[RegisterExtension|UnRegisterExtension]
_____________________________________________________________________________
${RegisterExtension} "[executable]" "[extension]" "[description]"
"[executable]" ; executable which opens the file format
;
"[extension]" ; extension, which represents the file format to open
;
"[description]" ; description for the extension. This will be display in Windows Explorer.
;
${UnRegisterExtension} "[extension]" "[description]"
"[extension]" ; extension, which represents the file format to open
;
"[description]" ; description for the extension. This will be display in Windows Explorer.
;
_____________________________________________________________________________
Macros
_____________________________________________________________________________
Change log window verbosity (default: 3=no script)
Example:
!include "FileAssociation.nsh"
!insertmacro RegisterExtension
${FileAssociation_VERBOSE} 4 # all verbosity
!insertmacro UnRegisterExtension
${FileAssociation_VERBOSE} 3 # no script
*/
!ifndef FileAssociation_INCLUDED
!define FileAssociation_INCLUDED
!include Util.nsh
!verbose push
!verbose 3
!ifndef _FileAssociation_VERBOSE
!define _FileAssociation_VERBOSE 3
!endif
!verbose ${_FileAssociation_VERBOSE}
!define FileAssociation_VERBOSE `!insertmacro FileAssociation_VERBOSE`
!verbose pop
!macro FileAssociation_VERBOSE _VERBOSE
!verbose push
!verbose 3
!undef _FileAssociation_VERBOSE
!define _FileAssociation_VERBOSE ${_VERBOSE}
!verbose pop
!macroend
!macro RegisterExtensionCall _EXECUTABLE _EXTENSION _DESCRIPTION
!verbose push
!verbose ${_FileAssociation_VERBOSE}
Push `${_DESCRIPTION}`
Push `${_EXTENSION}`
Push `${_EXECUTABLE}`
${CallArtificialFunction} RegisterExtension_
!verbose pop
!macroend
!macro UnRegisterExtensionCall _EXTENSION _DESCRIPTION
!verbose push
!verbose ${_FileAssociation_VERBOSE}
Push `${_EXTENSION}`
Push `${_DESCRIPTION}`
${CallArtificialFunction} UnRegisterExtension_
!verbose pop
!macroend
!define RegisterExtension `!insertmacro RegisterExtensionCall`
!define un.RegisterExtension `!insertmacro RegisterExtensionCall`
!macro RegisterExtension
!macroend
!macro un.RegisterExtension
!macroend
!macro RegisterExtension_
!verbose push
!verbose ${_FileAssociation_VERBOSE}
Exch $R2 ;exe
Exch
Exch $R1 ;ext
Exch
Exch 2
Exch $R0 ;desc
Exch 2
Push $0
Push $1
ReadRegStr $1 HKCR $R1 "" ; read current file association
StrCmp "$1" "" NoBackup ; is it empty
StrCmp "$1" "$R0" NoBackup ; is it our own
WriteRegStr HKCR $R1 "backup_val" "$1" ; backup current value
NoBackup:
WriteRegStr HKCR $R1 "" "$R0" ; set our file association
ReadRegStr $0 HKCR $R0 ""
StrCmp $0 "" 0 Skip
WriteRegStr HKCR "$R0" "" "$R0"
WriteRegStr HKCR "$R0\shell" "" "open"
WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0"
Skip:
WriteRegStr HKCR "$R0\shell\open\command" "" '"$R2" "%1"'
WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0"
WriteRegStr HKCR "$R0\shell\edit\command" "" '"$R2" "%1"'
Pop $1
Pop $0
Pop $R2
Pop $R1
Pop $R0
!verbose pop
!macroend
!define UnRegisterExtension `!insertmacro UnRegisterExtensionCall`
!define un.UnRegisterExtension `!insertmacro UnRegisterExtensionCall`
!macro UnRegisterExtension
!macroend
!macro un.UnRegisterExtension
!macroend
!macro UnRegisterExtension_
!verbose push
!verbose ${_FileAssociation_VERBOSE}
Exch $R1 ;desc
Exch
Exch $R0 ;ext
Exch
Push $0
Push $1
ReadRegStr $1 HKCR $R0 ""
StrCmp $1 $R1 0 NoOwn ; only do this if we own it
ReadRegStr $1 HKCR $R0 "backup_val"
StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
DeleteRegKey HKCR $R0
Goto NoOwn
Restore:
WriteRegStr HKCR $R0 "" $1
DeleteRegValue HKCR $R0 "backup_val"
DeleteRegKey HKCR $R1 ;Delete key with association name settings
NoOwn:
Pop $1
Pop $0
Pop $R1
Pop $R0
!verbose pop
!macroend
!endif # !FileAssociation_INCLUDED
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
+347
View File
@@ -0,0 +1,347 @@
;NSIS Modern User Interface
;Start Menu Folder Selection Example Script
;Written by Joost Verburg
;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
!include "nsDialogs.nsh"
!include "LogicLib.nsh"
!include "@NSIS_TARGETS_DIR@\FileAssociation.nsh"
!include "@NSIS_TARGETS_DIR@\FileFunc.nsh"
!include "@NSIS_TARGETS_DIR@\WordFunc.nsh"
;--------------------------------
;General
;Name and file
Name "@PROJECT_NAME@ Companion @VERSION_FAMILY@"
OutFile "companion-windows-@VERSION@.exe"
;Default installation folder
InstallDir "$PROGRAMFILES64\@PROJECT_NAME@\Companion @VERSION_FAMILY@"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\@PROJECT_NAME@\Companion @VERSION_FAMILY@" ""
;Compressor options
;SetCompress off
SetCompressor /FINAL /SOLID lzma
SetCompressorDictSize 64
;Request application privileges for Windows Vista
RequestExecutionLevel admin
;--------------------------------
;Variables
Var StartMenuFolder
Var StartMenuLocationDialog
Var StartMenuLocationRadioCurrent
Var StartMenuLocationRadioAll
Var StartMenuLocationValue ; "current_user" or "all_users"
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;File Exists Macro
; See http://nsis.sourceforge.net/Check_if_a_file_exists_at_compile_time for documentation
!macro !defineifexist _VAR_NAME _FILE_NAME
!tempfile _TEMPFILE
!ifdef NSIS_WIN32_MAKENSIS
; Windows - cmd.exe
!system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"'
!else
; Posix - sh
!system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi'
!endif
!include '${_TEMPFILE}'
!delfile '${_TEMPFILE}'
!undef _TEMPFILE
!macroend
!define !defineifexist "!insertmacro !defineifexist"
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE "@NSIS_DISTRO@\bin\license.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@PROJECT_NAME@\Companion @VERSION_FAMILY@"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
;Start Menu Folder for current user or all users?
Page custom StartMenuLocationCreator StartMenuLocationLeave
!insertmacro MUI_PAGE_INSTFILES
# These indented statements modify settings for MUI_PAGE_FINISH
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_CHECKED
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
# !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
# !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme.txt
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
;--------------------------------
;Installer Sections
; Visual C++ Redistributable (x64) is a required dependency
;
!macro GetInstalledVCVersionCall _RESULT
Call GetInstalledVCVersion
Pop ${_RESULT}
!macroend
!macro GetInstalledVCVersion
!ifndef GetInstalledVCVersion
!define GetInstalledVCVersion `!insertmacro GetInstalledVCVersionCall`
Function GetInstalledVCVersion
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" "Version"
StrCpy $R1 "$R0" 1 # get first character
${If} $R1 == "v"
StrCpy $R1 "$R0" "" 1 # strip off v prefix
${EndIf}
Push $R1
FunctionEnd
!endif
!macroend
!define VCREDISTNAME "Microsoft Visual C++ 2015-2022 Redistributable"
!define VCREDISTFILE "@NSIS_DISTRO@\bin\@NSIS_MSVC_REDIST_EXE@"
!define VCREDISTEXE "@NSIS_MSVC_REDIST_EXE@"
Var VCRedistExeVers
Var VCInstVers
!insertmacro GetFileVersion
!insertmacro VersionCompare
!insertmacro GetInstalledVCVersion
Section "${VCREDISTNAME}" SecMSVC
Push $0
Push $1
SetOutPath "$TEMP"
File "${VCREDISTFILE}"
${GetFileVersion} "$TEMP\${VCREDISTEXE}" $VCRedistExeVers
${GetInstalledVCVersion} $VCInstVers
${VersionCompare} "$VCInstVers" "$VCRedistExeVers" $R0
DetailPrint "VC++ Installed: $VCInstVers Redist: $VCRedistExeVers Result: $R0"
${If} $R0 == "2"
DetailPrint "Installing ${VCREDISTNAME}..."
ExecWait "$TEMP\${VCREDISTEXE} /install /passive /norestart"
;IfErrors InstallError ContinueInstall ; vc_redist exit code is unreliable
${GetInstalledVCVersion} $VCInstVers
${VersionCompare} "$VCInstVers" "$VCRedistExeVers" $R0
${If} $R0 == "0"
Goto ContinueInstall
${EndIf}
MessageBox MB_ICONSTOP "\
There was an unexpected error installing$\r$\n\
${VCREDISTNAME}.$\r$\n\
The installation of @PROJECT_NAME@ cannot continue."
Abort
${EndIf}
ContinueInstall:
Delete "$TEMP\${VCREDISTEXE}"
SetOutPath "$INSTDIR" ; Restore original output path
Pop $1
Pop $0
SectionEnd
Section "@PROJECT_NAME@ Companion @VERSION_FAMILY@" SecCpn
SetOutPath "$INSTDIR"
; Copy the complete distribution folder contents
File /r "@NSIS_DISTRO@\*"
;Store installation folder
WriteRegStr HKCU "Software\@PROJECT_NAME@\Companion @VERSION_FAMILY@" "" $INSTDIR
;Associate with extentions .etx
${registerExtension} "$INSTDIR\bin\companion.exe" ".etx" "@PROJECT_NAME@ Settings File"
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
;Registry information for add/remove programs
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME@ Companion @VERSION_FAMILY@" "DisplayName" "@PROJECT_NAME@ Companion @VERSION_FAMILY@"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME@ Companion @VERSION_FAMILY@" "DisplayVersion" "@VERSION@"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME@ Companion @VERSION_FAMILY@" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME@ Companion @VERSION_FAMILY@" "DisplayIcon" "$\"$INSTDIR\bin\companion.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME@ Companion @VERSION_FAMILY@" "Publisher" "@PROJECT_NAME@"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME@ Companion @VERSION_FAMILY@" "URLInfoAbout" "https://@PROJECT_NAME_LOWERCASE@.org"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME@ Companion @VERSION_FAMILY@" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S"
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
;Create shortcuts
${If} $StartMenuLocationValue == "all_users"
SetShellVarContext all
${Endif}
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Companion @VERSION_FAMILY@.lnk" "$INSTDIR\bin\companion.exe"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Firmware Simulator @VERSION_FAMILY@.lnk" "$INSTDIR\bin\simulator.exe"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall Companion @VERSION_FAMILY@.lnk" "$INSTDIR\Uninstall.exe"
SetShellVarContext current
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
;--------------------------------
;Descriptions
;Language strings
LangString DESC_SecCpn ${LANG_ENGLISH} "Models and settings editor for @PROJECT_NAME@"
LangString DESC_SecCpn ${LANG_FRENCH} "Editeur de r glages et mod les pour @PROJECT_NAME@"
LangString DESC_SecMSVC ${LANG_ENGLISH} "Install or update runtime library support files necessary for Companion"
LangString DESC_SecMSVC ${LANG_FRENCH} "Fichiers de support de bibliothèque d'exécution nécessaires pour Companion"
LangString SML_SubTitle ${LANG_ENGLISH} "Choose a location for the Start Menu shortcuts"
LangString SML_SubTitle ${LANG_FRENCH} "Choisissez un emplacement pour les raccourcis de l'application"
LangString SML_MainLabel ${LANG_ENGLISH} "Create start menu shortcuts for:"
LangString SML_MainLabel ${LANG_FRENCH} "Emplacement pour les raccourcis de l'application:"
LangString SML_RadioCurrent ${LANG_ENGLISH} "Current user only"
LangString SML_RadioCurrent ${LANG_FRENCH} "Utilisateur actuel"
LangString SML_RadioAll ${LANG_ENGLISH} "All users"
LangString SML_RadioAll ${LANG_FRENCH} "Tous les utilisateurs"
;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecCpn} $(DESC_SecCpn)
!insertmacro MUI_DESCRIPTION_TEXT ${SecMSVC} $(DESC_SecMSVC)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------
;Uninstaller Section
Section "un.${VCREDISTNAME}"
SectionEnd
Section "un.@PROJECT_NAME@ Companion @VERSION_FAMILY@"
SectionIn RO ; Not deselectable
RMDir /r "$INSTDIR\plugins\generic"
RMDir /r "$INSTDIR\plugins\iconengines"
RMDir /r "$INSTDIR\plugins\imageformats"
RMDir /r "$INSTDIR\plugins\multimedia"
RMDir /r "$INSTDIR\plugins\networkinformation"
RMDir /r "$INSTDIR\plugins\platforms"
RMDir /r "$INSTDIR\plugins\styles"
RMDir /r "$INSTDIR\plugins\tls"
RMDir /r "$INSTDIR\plugins"
RMDir /r "$INSTDIR\bin\__pycache__"
RMDir /r "$INSTDIR\bin"
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
${unregisterExtension} ".etx" "@PROJECT_NAME@ Settings File"
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
; Always remove start menu folder for both locations: current user and all users
SetShellVarContext all
Delete "$SMPROGRAMS\$StartMenuFolder\Companion @VERSION_FAMILY@.lnk"
Delete "$SMPROGRAMS\$StartMenuFolder\Firmware Simulator @VERSION_FAMILY@.lnk"
Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall Companion @VERSION_FAMILY@.lnk"
RMDir "$SMPROGRAMS\$StartMenuFolder"
SetShellVarContext current
Delete "$SMPROGRAMS\$StartMenuFolder\Companion @VERSION_FAMILY@.lnk"
Delete "$SMPROGRAMS\$StartMenuFolder\Firmware Simulator @VERSION_FAMILY@.lnk"
Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall Companion @VERSION_FAMILY@.lnk"
RMDir "$SMPROGRAMS\$StartMenuFolder"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME@ Companion @VERSION_FAMILY@"
SectionEnd
Section /o "un.Settings"
DeleteRegKey HKCU "Software\@PROJECT_NAME@\Companion @VERSION_FAMILY@"
SectionEnd
Function LaunchLink
ExecShell "" "$INSTDIR\bin\companion.exe"
FunctionEnd
; Custom page with radio buttons, if the start menu entries shall be created
; for the current user or for all users.
Function StartMenuLocationCreator
; Set default value if not already set. Do this before we might "abort" this page.
${If} $StartMenuLocationValue == ""
StrCpy $StartMenuLocationValue "current_user"
${EndIf}
; If the folder starts with >, the user has chosen not to create a shortcut (see NSIS/StartMenu.nsh)
StrCpy $R0 $StartMenuFolder 1
${If} $R0 == ">"
Abort
${EndIf}
!insertmacro MUI_HEADER_TEXT_PAGE $(MUI_TEXT_STARTMENU_TITLE) $(SML_SubTitle)
nsDialogs::Create 1018
Pop $StartMenuLocationDialog
${If} $StartMenuLocationDialog == error
Abort
${EndIf}
${NSD_CreateLabel} 0u 0u 100% 12u $(SML_MainLabel)
Pop $R0
${NSD_CreateRadioButton} 8u 20u 100% 12u $(SML_RadioCurrent)
Pop $StartMenuLocationRadioCurrent
${NSD_AddStyle} $StartMenuLocationRadioCurrent ${WS_GROUP}
${NSD_CreateRadioButton} 8u 40u 100% 12u $(SML_RadioAll)
Pop $StartMenuLocationRadioAll
${If} $StartMenuLocationValue == "all_users"
${NSD_SetState} $StartMenuLocationRadioAll ${BST_CHECKED}
${Else}
${NSD_SetState} $StartMenuLocationRadioCurrent ${BST_CHECKED}
${EndIf}
${NSD_OnBack} StartMenuLocationLeave
nsDialogs::Show
FunctionEnd
; Converts the radio button state back into a value for "StartMenuLocationValue"
Function StartMenuLocationLeave
${NSD_GetState} $StartMenuLocationRadioAll $R0
${If} $R0 == ${BST_CHECKED}
StrCpy $StartMenuLocationValue "all_users"
${Else}
StrCpy $StartMenuLocationValue "current_user"
${Endif}
FunctionEnd