Skip to content

Commit 272e8ce

Browse files
committed
Initial version based on VLC Media Player 3.0.6
0 parents  commit 272e8ce

File tree

14 files changed

+319
-0
lines changed

14 files changed

+319
-0
lines changed

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This file is for unifying the coding style for different editors and IDEs.
2+
# More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 2
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[*.go]
18+
indent_style = tab

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Intellij
2+
/.idea
3+
/*.iml
4+
5+
# App
6+
/.dev
7+
/bin
8+
/vendor
9+
/*.syso
10+
/*.exe
11+
/versioninfo.json

.travis.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
os: windows
2+
language: shell
3+
4+
env:
5+
global:
6+
- GOVERSION: 1.11.5
7+
- NODEJS_VERSION: 11.9.0
8+
9+
before_install:
10+
- git clone https://github.com/portapps/portapps ${TRAVIS_BUILD_DIR}/../portapps
11+
- source ${TRAVIS_BUILD_DIR}/../portapps/.travis/prepare.sh
12+
- bash ${TRAVIS_BUILD_DIR}/../portapps/.travis/java.sh
13+
- bash ${TRAVIS_BUILD_DIR}/../portapps/.travis/ant.sh
14+
- bash ${TRAVIS_BUILD_DIR}/../portapps/.travis/nodejs.sh
15+
- bash ${TRAVIS_BUILD_DIR}/../portapps/.travis/go.sh
16+
- set
17+
18+
script:
19+
- ant release
20+
21+
after_success:
22+
- export APP_VERSION=$(cat $TRAVIS_BUILD_DIR/bin/tmp/version.dat)
23+
- echo ${APP_VERSION}
24+
25+
before_deploy:
26+
- git config --local user.email "builds@travis-ci.com"
27+
- git config --local user.name "Travis CI"
28+
- export TRAVIS_TAG="${APP_VERSION}"
29+
- git tag $TRAVIS_TAG
30+
- ls -al bin/release
31+
32+
deploy:
33+
provider: releases
34+
api_key:
35+
secure: Hfngpb80fUuSPuDq0RCzGng+ZsTTEYShRYJGpc2QjvoGsybPzgVhjA61tpHb33Wogc+yE2GcfQUrmg6C5azd110H43sBf18FOtslrjLHdTmPyZEOJqWhwnEdvOt6VL/XWwSjDf/sAxU0+tliWis5kDBxoguG4qlY06wfT6rmyQgdS8Hq7Tev65sfTYd2x7DkbA4OJP+fz5n5FpZJtCjhmnoDP2VWUupgCVkfn6MrGX4oHQcrs3vCpnc5q5xEzuBHwg1H38VgaGW9bNst+gyTuc0GneU/7BPC4O8zYAKZltRHFKybjF1oi4eDFtItA5cKMnKpohjno/KdA2uUll6vcpmOVh0kHaSbLH4Gl24zdvJ8Gvd2sT+Gixz3Eh8MqM0YZ1sZwPffCRRwik+1C21Zk8rIkG/r2ew0bJJlnPjd1Ng+OEKW68pK4AN2R0iG0Fqo1XXah8nK+EzHubZVa7NWjSpsLy6FXyBTn+NEvK5gPzyP/ngJz7snoL3Pzz/hGQlHSVVxUZQZgOYWnlYpf3MgS4i4N4FEpTez+M4S+yZh8HoZQddBFZTCobnWhqMTYPLjjcUxcQC3+C1mQyGA1mIriHpky/88fuUBF73m6oQyHoGYfL3z+/8jO02wHf+yD6NKA1w257BAZlyuOdvq1/rv1+zEskCnxD2J2F/gYfVJluM=
36+
file_glob: true
37+
file: bin/release/*
38+
skip_cleanup: true
39+
draft: true
40+
on:
41+
tags: false

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Portapps
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<p align="center"><a href="https://portapps.io/app/vlc-portable/" target="_blank"><img width="100" src="https://github.com/portapps/vlc-portable/blob/master/res/papp.png"></a></p>
2+
3+
<p align="center">
4+
<a href="https://portapps.io/app/vlc-portable/#download"><img src="https://img.shields.io/github/release/portapps/vlc-portable.svg?style=flat-square" alt="GitHub release"></a>
5+
<a href="https://portapps.io/app/vlc-portable/#download"><img src="https://img.shields.io/github/downloads/portapps/vlc-portable/total.svg?style=flat-square" alt="Total downloads"></a>
6+
<a href="https://github.com/portapps/portapps"><img src="https://img.shields.io/badge/portapps-1.20.3-479fdb.svg?style=flat-square" alt="Portapps version"></a>
7+
<a href="https://ci.appveyor.com/project/portapps/vlc-portable"><img src="https://img.shields.io/appveyor/ci/portapps/vlc-portable.svg?style=flat-square" alt="AppVeyor"></a>
8+
<a href="https://goreportcard.com/report/github.com/portapps/vlc-portable"><img src="https://goreportcard.com/badge/github.com/portapps/vlc-portable?style=flat-square" alt="Go Report"></a>
9+
<a href="https://www.codacy.com/app/portapps/vlc-portable"><img src="https://img.shields.io/codacy/grade/10aa1a67c6154f7faab71fef032b4786.svg?style=flat-square" alt="Code Quality"></a>
10+
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WQD7AQGPDEPSG"><img src="https://img.shields.io/badge/donate-paypal-7057ff.svg?style=flat-square" alt="Donate Paypal"></a>
11+
</p>
12+
13+
## About
14+
15+
[VLC Media Player](https://www.videolan.org/vlc/) portable app made with 🚀 [Portapps](https://portapps.io).<br />
16+
Documentation and downloads can be found on https://portapps.io/app/vlc-portable/
17+
18+
## How can I help ?
19+
20+
All kinds of contributions are welcome :raised_hands:!<br />
21+
The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon:<br />
22+
But we're not gonna lie to each other, I'd rather you buy me a beer or two :beers:!
23+
24+
[![Paypal Donate](https://portapps.io/img/paypal-donate.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WQD7AQGPDEPSG)
25+
26+
## License
27+
28+
MIT. See `LICENSE` for more details.<br />
29+
Rocket icon credit to [Squid Ink](http://thesquid.ink).

build.properties

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Portapps
2+
debug = true
3+
#core.dir = vendor/github.com/portapps/portapps
4+
core.dir = ../portapps
5+
6+
# App
7+
app = vlc
8+
app.name = VLC
9+
app.type = archive
10+
app.version = 3.0.6
11+
12+
# Portable app
13+
papp.id = ${app}-portable
14+
papp.guid = {727DA819-F380-43E4-943A-2A418A0D8270}
15+
papp.name = ${app.name} Portable
16+
papp.desc = ${app.name} portable on Windows by Portapps
17+
papp.url = https://github.com/portapps/${papp.id}
18+
papp.folder = app
19+
20+
# Official artifacts
21+
atf.id = vlc
22+
atf.win32.filename = vlc-${app.version}-win32
23+
atf.win32.ext = .zip
24+
atf.win32.url = http://download.videolan.org/vlc/${app.version}/win32/vlc-${app.version}-win32.zip
25+
atf.win32.assertextract = vlc-${app.version}/vlc.exe
26+
atf.win64.filename = vlc-${app.version}-win64
27+
atf.win64.ext = .zip
28+
atf.win64.url = http://download.videolan.org/vlc/${app.version}/win64/vlc-${app.version}-win64.zip
29+
atf.win64.assertextract = vlc-${app.version}/vlc.exe

build.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project name="vlc" basedir=".">
3+
4+
<dirname property="app.basedir" file="${ant.file.vlc}"/>
5+
<property name="build.properties" value="${app.basedir}/build.properties"/>
6+
<property file="${build.properties}"/>
7+
8+
<!-- Load Portapps core build -->
9+
<property name="core.basedir" location="${app.basedir}\${core.dir}"/>
10+
<fail unless="core.basedir" message="Core directory '${core.basedir}' not found in ${core.basedir}"/>
11+
<echo message="Core found in ${core.basedir}" level="debug"/>
12+
13+
<!-- Import build-app.xml -->
14+
<import file="${core.basedir}\.build\build-app.xml"/>
15+
16+
<!-- Targets -->
17+
<target name="release" depends="release.app" description="Release"/>
18+
19+
<target name="prepare">
20+
<echo message="Preparing release..."/>
21+
22+
<move todir="${tmp.path}\extract2">
23+
<fileset dir="${extract.path}\vlc-${app.version}"/>
24+
</move>
25+
<delete dir="${extract.path}"/>
26+
<move todir="${extract.path}">
27+
<fileset dir="${tmp.path}\extract2"/>
28+
</move>
29+
</target>
30+
31+
</project>

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/portapps/vlc-portable
2+
3+
require github.com/portapps/portapps v1.20.3

go.sum

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
github.com/akavel/rsrc v0.0.0-20170831122431-f6a15ece2cfd h1:yumR8733CaQ3P76MFbIbBKdrJmy4EqnQ5DIhqq8gq2Q=
2+
github.com/akavel/rsrc v0.0.0-20170831122431-f6a15ece2cfd/go.mod h1:2+aQMrY0hBFBaIr2xxnZ/ctfwnYmMRMbTczYLAC34v4=
3+
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
4+
github.com/ilya1st/rotatewriter v0.0.0-20171126183947-3df0c1a3ed6d h1:OGuVAVny/97zsQ5BWg0mOjzTBBD9zR+Lug1co144+rU=
5+
github.com/ilya1st/rotatewriter v0.0.0-20171126183947-3df0c1a3ed6d/go.mod h1:S1q6q+21PRGd0WRX+fHjQ+TOe3CgpSv7zgCWnZcbxCs=
6+
github.com/josephspurrier/goversioninfo v0.0.0-20190209210621-63e6d1acd3dd h1:KikNiFwUO3QLyeKyN4k9yBH9Pcu/gU/yficWi61cJIw=
7+
github.com/josephspurrier/goversioninfo v0.0.0-20190209210621-63e6d1acd3dd/go.mod h1:eJTEwMjXb7kZ633hO3Ln9mBUCOjX2+FlTljvpl9SYdE=
8+
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
9+
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
10+
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
11+
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
12+
github.com/portapps/portapps v1.20.3 h1:MrJBut5hDaPWvDwxJnNShNa6W+XBayRbu24EmRG2hcQ=
13+
github.com/portapps/portapps v1.20.3/go.mod h1:fC0WzbwzixQmZ1MwMCR1bH87H1fG6NO55MAJ2NdB+i4=
14+
github.com/rs/zerolog v1.12.0 h1:aqZ1XRadoS8IBknR5IDFvGzbHly1X9ApIqOroooQF/c=
15+
github.com/rs/zerolog v1.12.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
16+
golang.org/x/sys v0.0.0-20190308023053-584f3b12f43e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
17+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
18+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
19+
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
20+
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

main.go

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
//go:generate go install -v github.com/josephspurrier/goversioninfo/cmd/goversioninfo
2+
//go:generate goversioninfo -icon=res/papp.ico
3+
package main
4+
5+
import (
6+
"os"
7+
8+
. "github.com/portapps/portapps"
9+
"github.com/portapps/portapps/pkg/registry"
10+
"github.com/portapps/portapps/pkg/utl"
11+
)
12+
13+
type config struct {
14+
Verbose string `yaml:"verbose" mapstructure:"verbose"`
15+
}
16+
17+
var (
18+
app *App
19+
cfg *config
20+
)
21+
22+
func init() {
23+
var err error
24+
25+
// Default config
26+
cfg = &config{
27+
Verbose: "1",
28+
}
29+
30+
// Init app
31+
if app, err = NewWithCfg("vlc-portable", "VLC", cfg); err != nil {
32+
Log.Fatal().Err(err).Msg("Cannot initialize application. See log file for more info.")
33+
}
34+
}
35+
36+
func main() {
37+
utl.CreateFolder(app.DataPath)
38+
app.Process = utl.PathJoin(app.AppPath, "vlc.exe")
39+
app.Args = []string{
40+
"--vlm-conf=" + utl.PathJoin(app.DataPath, "vlcrc"),
41+
"--config=" + utl.PathJoin(app.DataPath, "vlcrc"),
42+
"--no-plugins-cache",
43+
"--no-qt-updates-notif",
44+
}
45+
46+
// VLC paths
47+
vlcRoamingPath := utl.PathJoin(utl.RoamingPath(), "vlc")
48+
vlcTmpPath := utl.CreateFolder(app.AppPath, "tmp")
49+
50+
// Set env vars
51+
utl.OverrideEnv("VLC_PLUGIN_PATH", utl.CreateFolder(app.DataPath, "plugins"))
52+
utl.OverrideEnv("VLC_VERBOSE", cfg.Verbose)
53+
utl.OverrideEnv("TEMP", vlcTmpPath)
54+
55+
// VLC volatile files
56+
dataDvdcssPath := utl.PathJoin(app.DataPath, "dvdcss")
57+
dataMlXspf := utl.PathJoin(app.DataPath, "ml.xspf")
58+
dataVlcQtInterface := utl.PathJoin(app.DataPath, "vlc-qt-interface.ini")
59+
roamingDvdcssPath := utl.PathJoin(utl.RoamingPath(), "dvdcss")
60+
roamingMlXspf := utl.PathJoin(vlcRoamingPath, "ml.xspf")
61+
roamingVlcQtInterface := utl.PathJoin(vlcRoamingPath, "vlc-qt-interface.ini")
62+
63+
// Copy existing files from data to roaming folder for the current user
64+
utl.CreateFolder(vlcRoamingPath)
65+
if _, err := os.Stat(dataMlXspf); err == nil {
66+
utl.CopyFile(dataMlXspf, roamingMlXspf)
67+
}
68+
if _, err := os.Stat(dataVlcQtInterface); err == nil {
69+
utl.CopyFile(dataVlcQtInterface, roamingVlcQtInterface)
70+
}
71+
72+
// Handle reg key
73+
regsPath := utl.CreateFolder(app.RootPath, "reg")
74+
regFile := utl.PathJoin(regsPath, "VLC.reg")
75+
regKey := registry.ExportImport{
76+
Key: `HKCU\Software\VideoLAN\VLC`,
77+
Arch: "32",
78+
File: regFile,
79+
}
80+
if err := registry.ImportKey(regKey); err != nil {
81+
Log.Warn().Err(err).Msg("Cannot import registry key")
82+
}
83+
84+
// On exit
85+
defer func() {
86+
// Copy back to data
87+
if _, err := os.Stat(dataDvdcssPath); err == nil {
88+
if err = utl.CopyFolder(dataDvdcssPath, roamingDvdcssPath); err != nil {
89+
Log.Warn().Err(err).Msgf("Cannot copy back %s", dataDvdcssPath)
90+
}
91+
}
92+
if _, err := os.Stat(roamingMlXspf); err == nil {
93+
if err = utl.CopyFile(roamingMlXspf, dataMlXspf); err != nil {
94+
Log.Warn().Err(err).Msgf("Cannot copy back %s", roamingMlXspf)
95+
}
96+
}
97+
if _, err := os.Stat(roamingVlcQtInterface); err == nil {
98+
if err = utl.CopyFile(roamingVlcQtInterface, dataVlcQtInterface); err != nil {
99+
Log.Warn().Err(err).Msgf("Cannot copy back %s", roamingVlcQtInterface)
100+
}
101+
}
102+
103+
// Export registry key
104+
os.Remove(regFile)
105+
if err := registry.ExportKey(regKey); err != nil {
106+
Log.Warn().Err(err).Msg("Cannot export registry key")
107+
}
108+
109+
// Remove tmp and roaming path
110+
os.RemoveAll(vlcTmpPath)
111+
os.RemoveAll(vlcRoamingPath)
112+
}()
113+
114+
// Launch
115+
app.Launch(os.Args[1:])
116+
}

0 commit comments

Comments
 (0)