bedre installer
This commit is contained in:
@@ -83,7 +83,7 @@ exe = EXE(
|
||||
strip=False,
|
||||
upx=False,
|
||||
console=False,
|
||||
icon=None,
|
||||
icon='installer\\icon.ico',
|
||||
)
|
||||
|
||||
coll = COLLECT(
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
!define APP_VERSION "1.0.0"
|
||||
!define APP_PUBLISHER "LineDance Player"
|
||||
!define APP_URL "https://linedanceplayer.dk"
|
||||
!define INSTALL_DIR "$LOCALAPPDATA\Programs\LineDancePlayer"
|
||||
!define INSTALL_DIR "$LOCALAPPDATA\LineDancePlayer"
|
||||
!define REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\LineDancePlayer"
|
||||
|
||||
; ── Generelle indstillinger ───────────────────────────────────────────────────
|
||||
@@ -50,16 +50,17 @@ Section "LineDance Player" SecMain
|
||||
SectionIn RO ; Obligatorisk
|
||||
|
||||
SetOutPath "$INSTDIR"
|
||||
File "dist\LineDancePlayer\LineDancePlayer.exe"
|
||||
|
||||
; Kopiér alle filer fra dist\LineDancePlayer\
|
||||
File /r "dist\LineDancePlayer\*.*"
|
||||
SetOutPath "$INSTDIR\_internal"
|
||||
File /r "dist\LineDancePlayer\_internal\*"
|
||||
|
||||
; Start-menu genvej
|
||||
CreateDirectory "$SMPROGRAMS\${APP_NAME}"
|
||||
CreateShortcut "$SMPROGRAMS\${APP_NAME}\${APP_NAME}.lnk" \
|
||||
"$INSTDIR\${APP_EXE}" "" "$INSTDIR\${APP_EXE}" 0
|
||||
|
||||
; Skrivebords-genvej (valgfri — spørg brugeren)
|
||||
; Skrivebords-genvej
|
||||
CreateShortcut "$DESKTOP\${APP_NAME}.lnk" \
|
||||
"$INSTDIR\${APP_EXE}" "" "$INSTDIR\${APP_EXE}" 0
|
||||
|
||||
@@ -84,18 +85,33 @@ Section "LineDance Player" SecMain
|
||||
|
||||
SectionEnd
|
||||
|
||||
; ── VLC tjek (advarsel hvis ikke installeret) ─────────────────────────────────
|
||||
; ── VLC tjek ──────────────────────────────────────────────────────────────────
|
||||
Section -VLCCheck
|
||||
; Tjek alle kendte VLC registry-stier
|
||||
ReadRegStr $0 HKLM "SOFTWARE\VideoLAN\VLC" ""
|
||||
ReadRegStr $1 HKCU "SOFTWARE\VideoLAN\VLC" ""
|
||||
${If} $0 == ""
|
||||
${AndIf} $1 == ""
|
||||
ReadRegStr $2 HKLM "SOFTWARE\WOW6432Node\VideoLAN\VLC" ""
|
||||
; Tjek også om vlc.exe eksisterer
|
||||
IfFileExists "$PROGRAMFILES\VideoLAN\VLC\vlc.exe" VLCFound 0
|
||||
IfFileExists "$PROGRAMFILES64\VideoLAN\VLC\vlc.exe" VLCFound 0
|
||||
${If} $0 != ""
|
||||
Goto VLCFound
|
||||
${EndIf}
|
||||
${If} $1 != ""
|
||||
Goto VLCFound
|
||||
${EndIf}
|
||||
${If} $2 != ""
|
||||
Goto VLCFound
|
||||
${EndIf}
|
||||
; VLC ikke fundet
|
||||
MessageBox MB_YESNO|MB_ICONINFORMATION \
|
||||
"LineDance Player bruger VLC til afspilning.$\n$\nVLC er ikke installeret. Vil du åbne download-siden?$\n$\n(Du kan installere det senere)" \
|
||||
"LineDance Player bruger VLC til afspilning.$\n$\nVLC ser ikke ud til at vaere installeret.$\n$\nVil du aabne download-siden nu?$\n$\n(Du kan installere VLC senere)" \
|
||||
IDNO VLCSkip
|
||||
ExecShell "open" "https://www.videolan.org/vlc/"
|
||||
VLCSkip:
|
||||
${EndIf}
|
||||
Goto VLCDone
|
||||
VLCFound:
|
||||
VLCDone:
|
||||
SectionEnd
|
||||
|
||||
; ── Afinstaller ───────────────────────────────────────────────────────────────
|
||||
@@ -111,6 +127,13 @@ Section "Uninstall"
|
||||
; Slet registry
|
||||
DeleteRegKey HKCU "${REG_KEY}"
|
||||
|
||||
; Bevar brugernes data i %APPDATA%\.linedance — slet IKKE
|
||||
; Spørg om brugerdata skal slettes
|
||||
IfFileExists "$PROFILE\.linedance\*" AskDelete SkipDelete
|
||||
AskDelete:
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION \
|
||||
"Vil du slette dine lokale data?$\n$\nDette fjerner din musikdatabase, indstillinger og playlister fra:$\n$PROFILE\.linedance$\n$\nVaelg Nej for at beholde dine data." \
|
||||
IDNO SkipDelete
|
||||
RMDir /r "$PROFILE\.linedance"
|
||||
SkipDelete:
|
||||
|
||||
SectionEnd
|
||||
|
||||
Reference in New Issue
Block a user