Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
0488b50a
Commit
0488b50a
authored
Sep 27, 2013
by
Ludovic Fauvet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nsis: split files and clean up
parent
29d2fc1b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
245 additions
and
222 deletions
+245
-222
extras/package/win32/NSIS/helpers/utils.nsh
extras/package/win32/NSIS/helpers/utils.nsh
+242
-0
extras/package/win32/NSIS/vlc.win32.nsi.in
extras/package/win32/NSIS/vlc.win32.nsi.in
+3
-222
No files found.
extras/package/win32/NSIS/helpers/utils.nsh
0 → 100644
View file @
0488b50a
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Utils ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Delete prefs Macro ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!macro delprefs
StrCpy $0 0
!define Index 'Line${__LINE__}'
"${Index}-Loop:"
; FIXME
; this will loop through all the logged users and "virtual" windows users
; (it looks like users are only present in HKEY_USERS when they are logged in)
ClearErrors
EnumRegKey $1 HKU "" $0
StrCmp $1 "" "${Index}-End"
IntOp $0 $0 + 1
ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
StrCmp $2 "" "${Index}-Loop"
RMDir /r "$2\vlc"
Goto "${Index}-Loop"
"${Index}-End:"
!undef Index
!macroend
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Start VLC with dropped privileges ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function AppExecAs
${If} ${AtLeastWinVista}
Exec '"$WINDIR\explorer.exe" "$INSTDIR\vlc.exe"'
${Else}
Exec '$INSTDIR\vlc.exe'
${Endif}
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Parse the command line ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function ParseCommandline
${GetParameters} $R0
${GetOptions} $R0 "/update" $R1
${If} ${Errors}
StrCpy $PerformUpdate 0
${Else}
StrCpy $PerformUpdate 1
${EndIf}
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Read previous version from ;
; the registry ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function ReadPreviousVersion
ReadRegStr $PreviousInstallDir HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir"
Call CheckPrevInstallDirExists
${If} $PreviousInstallDir != ""
;Detect version
ReadRegStr $PreviousVersion HKLM "${PRODUCT_DIR_REGKEY}" "Version"
${EndIf}
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Check if the previous install ;
; directory still exists ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function CheckPrevInstallDirExists
${If} $PreviousInstallDir != ""
; Make sure directory is valid
Push $R0
Push $R1
StrCpy $R0 "$PreviousInstallDir" "" -1
${If} $R0 == '\'
${OrIf} $R0 == '/'
StrCpy $R0 $PreviousInstallDir*.*
${Else}
StrCpy $R0 $PreviousInstallDir\*.*
${EndIf}
${IfNot} ${FileExists} $R0
StrCpy $PreviousInstallDir ""
${EndIf}
Pop $R1
Pop $R0
${EndIf}
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Compare two versions and return ;
; whether the new one is "newer", ;
; the "same" or "older" ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function VersionCompare
Exch $1
Exch
Exch $0
Push $2
Push $3
Push $4
versioncomparebegin:
${If} $0 == ""
${AndIf} $1 == ""
StrCpy $PreviousVersionState "same"
goto versioncomparedone
${EndIf}
StrCpy $2 0
StrCpy $3 0
; Parse rc / beta suffixes for segments
StrCpy $4 $0 2
${If} $4 == "rc"
StrCpy $2 100
StrCpy $0 $0 "" 2
${Else}
StrCpy $4 $0 4
${If} $4 == "beta"
StrCpy $0 $0 "" 4
${Else}
StrCpy $2 10000
${EndIf}
${EndIf}
StrCpy $4 $1 2
${If} $4 == "rc"
StrCpy $3 100
StrCpy $1 $1 "" 2
${Else}
StrCpy $4 $1 4
${If} $4 == "beta"
StrCpy $1 $1 "" 4
${Else}
StrCpy $3 10000
${EndIf}
${EndIf}
split1loop:
StrCmp $0 "" split1loopdone
StrCpy $4 $0 1
StrCpy $0 $0 "" 1
StrCmp $4 "." split1loopdone
StrCmp $4 "-" split1loopdone
StrCpy $2 $2$4
goto split1loop
split1loopdone:
split2loop:
StrCmp $1 "" split2loopdone
StrCpy $4 $1 1
StrCpy $1 $1 "" 1
StrCmp $4 "." split2loopdone
StrCmp $4 "-" split2loopdone
StrCpy $3 $3$4
goto split2loop
split2loopdone:
${If} $2 > $3
StrCpy $PreviousVersionState "newer"
${ElseIf} $3 > $2
StrCpy $PreviousVersionState "older"
${Else}
goto versioncomparebegin
${EndIf}
versioncomparedone:
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TrimNewlines (copied from NSIS documentation) ;
; input: top of stack (e.g. whatever$\r$\n) ;
; output: top of stack (replaces, with e.g. whatever) ;
; modifies no other variables. ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function un.TrimNewlines
Exch $R0
Push $R1
Push $R2
StrCpy $R1 0
loop:
IntOp $R1 $R1 - 1
StrCpy $R2 $R0 1 $R1
StrCmp $R2 "$\r" loop
StrCmp $R2 "$\n" loop
IntOp $R1 $R1 + 1
IntCmp $R1 0 no_trim_needed
StrCpy $R0 $R0 $R1
no_trim_needed:
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
Function un.RemoveEmptyDirs
Pop $9
!define Index 'Line${__LINE__}'
FindFirst $0 $1 "$INSTDIR$9*"
StrCmp $0 "" "${Index}-End"
"${Index}-Loop:"
StrCmp $1 "" "${Index}-End"
StrCmp $1 "." "${Index}-Next"
StrCmp $1 ".." "${Index}-Next"
Push $0
Push $1
Push $9
Push "$9$1\"
Call un.RemoveEmptyDirs
Pop $9
Pop $1
Pop $0
"${Index}-Remove:"
RMDir "$INSTDIR$9$1"
"${Index}-Next:"
FindNext $0 $1
Goto "${Index}-Loop"
"${Index}-End:"
FindClose $0
!undef Index
FunctionEnd
\ No newline at end of file
extras/package/win32/NSIS/vlc.win32.nsi.in
View file @
0488b50a
...
...
@@ -99,15 +99,6 @@ RequestExecutionLevel user
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
Function AppExecAs
${If} ${AtLeastWinVista}
Exec '"$WINDIR\explorer.exe" "$INSTDIR\vlc.exe"'
${Else}
Exec '$INSTDIR\vlc.exe'
${Endif}
FunctionEnd
!define MUI_PAGE_CUSTOMFUNCTION_PRE PageFastUpdatePre
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION AppExecAs
...
...
@@ -157,38 +148,13 @@ RequestExecutionLevel user
; Reserve files for solid compression
!insertmacro MUI_RESERVEFILE_LANGDLL
; MUI end ------
;;;;;;;;;;;;;;;;;;;;;;;
; Macro and Functions ;
;;;;;;;;;;;;;;;;;;;;;;;
!include helpers/extensions.nsh
Var UninstallLog
!include helpers/install.nsh
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Delete prefs Macro ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!macro delprefs
StrCpy $0 0
!define Index 'Line${__LINE__}'
"${Index}-Loop:"
; FIXME
; this will loop through all the logged users and "virtual" windows users
; (it looks like users are only present in HKEY_USERS when they are logged in)
ClearErrors
EnumRegKey $1 HKU "" $0
StrCmp $1 "" "${Index}-End"
IntOp $0 $0 + 1
ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
StrCmp $2 "" "${Index}-Loop"
RMDir /r "$2\vlc"
Goto "${Index}-Loop"
"${Index}-End:"
!undef Index
!macroend
!include helpers/utils.nsh
;;;;;;;;;;;;;;;;;;;;;;
; Installer sections ;
...
...
@@ -650,18 +616,7 @@ UAC_Success:
FunctionEnd
Function ParseCommandline
${GetParameters} $R0
${GetOptions} $R0 "/update" $R1
${If} ${Errors}
StrCpy $PerformUpdate 0
${Else}
StrCpy $PerformUpdate 1
${EndIf}
FunctionEnd
;;; Page to upgrade / downgrade or customize the installation
Function PageReinstall
${If} $PreviousVersion == ""
Abort
...
...
@@ -758,128 +713,6 @@ Function PageLeaveReinstall
FunctionEnd
Function ReadPreviousVersion
ReadRegStr $PreviousInstallDir HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir"
Call CheckPrevInstallDirExists
${If} $PreviousInstallDir != ""
;Detect version
ReadRegStr $PreviousVersion HKLM "${PRODUCT_DIR_REGKEY}" "Version"
${EndIf}
FunctionEnd
Function CheckPrevInstallDirExists
${If} $PreviousInstallDir != ""
; Make sure directory is valid
Push $R0
Push $R1
StrCpy $R0 "$PreviousInstallDir" "" -1
${If} $R0 == '\'
${OrIf} $R0 == '/'
StrCpy $R0 $PreviousInstallDir*.*
${Else}
StrCpy $R0 $PreviousInstallDir\*.*
${EndIf}
${IfNot} ${FileExists} $R0
StrCpy $PreviousInstallDir ""
${EndIf}
Pop $R1
Pop $R0
${EndIf}
FunctionEnd
Function VersionCompare
Exch $1
Exch
Exch $0
Push $2
Push $3
Push $4
versioncomparebegin:
${If} $0 == ""
${AndIf} $1 == ""
StrCpy $PreviousVersionState "same"
goto versioncomparedone
${EndIf}
StrCpy $2 0
StrCpy $3 0
; Parse rc / beta suffixes for segments
StrCpy $4 $0 2
${If} $4 == "rc"
StrCpy $2 100
StrCpy $0 $0 "" 2
${Else}
StrCpy $4 $0 4
${If} $4 == "beta"
StrCpy $0 $0 "" 4
${Else}
StrCpy $2 10000
${EndIf}
${EndIf}
StrCpy $4 $1 2
${If} $4 == "rc"
StrCpy $3 100
StrCpy $1 $1 "" 2
${Else}
StrCpy $4 $1 4
${If} $4 == "beta"
StrCpy $1 $1 "" 4
${Else}
StrCpy $3 10000
${EndIf}
${EndIf}
split1loop:
StrCmp $0 "" split1loopdone
StrCpy $4 $0 1
StrCpy $0 $0 "" 1
StrCmp $4 "." split1loopdone
StrCmp $4 "-" split1loopdone
StrCpy $2 $2$4
goto split1loop
split1loopdone:
split2loop:
StrCmp $1 "" split2loopdone
StrCpy $4 $1 1
StrCpy $1 $1 "" 1
StrCmp $4 "." split2loopdone
StrCmp $4 "-" split2loopdone
StrCpy $3 $3$4
goto split2loop
split2loopdone:
${If} $2 > $3
StrCpy $PreviousVersionState "newer"
${ElseIf} $3 > $2
StrCpy $PreviousVersionState "older"
${Else}
goto versioncomparebegin
${EndIf}
versioncomparedone:
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd
Function RunUninstaller
ReadRegStr $R1 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString"
${If} $R1 == ""
...
...
@@ -909,6 +742,7 @@ Function PageSkipPre
${EndIf}
FunctionEnd
;;; Used during upgrade to skip most pages
Function PageFastUpdatePre
${If} $PerformUpdate == 1
Abort
...
...
@@ -967,59 +801,6 @@ SectionEnd
; Uninstaller sections ;
;;;;;;;;;;;;;;;;;;;;;;;;
; TrimNewlines (copied from NSIS documentation)
; input, top of stack (e.g. whatever$\r$\n)
; output, top of stack (replaces, with e.g. whatever)
; modifies no other variables.
Function un.TrimNewlines
Exch $R0
Push $R1
Push $R2
StrCpy $R1 0
loop:
IntOp $R1 $R1 - 1
StrCpy $R2 $R0 1 $R1
StrCmp $R2 "$\r" loop
StrCmp $R2 "$\n" loop
IntOp $R1 $R1 + 1
IntCmp $R1 0 no_trim_needed
StrCpy $R0 $R0 $R1
no_trim_needed:
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
Function un.RemoveEmptyDirs
Pop $9
!define Index 'Line${__LINE__}'
FindFirst $0 $1 "$INSTDIR$9*"
StrCmp $0 "" "${Index}-End"
"${Index}-Loop:"
StrCmp $1 "" "${Index}-End"
StrCmp $1 "." "${Index}-Next"
StrCmp $1 ".." "${Index}-Next"
Push $0
Push $1
Push $9
Push "$9$1\"
Call un.RemoveEmptyDirs
Pop $9
Pop $1
Pop $0
"${Index}-Remove:"
RMDir "$INSTDIR$9$1"
"${Index}-Next:"
FindNext $0 $1
Goto "${Index}-Loop"
"${Index}-End:"
FindClose $0
!undef Index
FunctionEnd
Section "un.$Name_Section91" SEC91
SectionIn 1 2 3 RO
SetShellVarContext all
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment