Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
azubieta
appimage-installer
Commits
b4fc9bf5
Verified
Commit
b4fc9bf5
authored
Dec 13, 2019
by
azubieta
Browse files
Merge branch 'development'
parents
080e7426
4f2b9b89
Pipeline
#1417
passed with stages
in 18 minutes and 31 seconds
Changes
8
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
b4fc9bf5
...
...
@@ -56,7 +56,7 @@ build:debian_buster_pkg:
script
:
-
cmake -DINSTALL_LIBAPPIMAGE=On -DINSTALL_ATTICA=On -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .
-
make -j`nproc`
-
cpack -G DEB -G DEB -R 1.0.
1
-debian-buster
-
cpack -G DEB -G DEB -R 1.0.
2
-debian-buster
artifacts
:
paths
:
-
appimage-installer*.deb
...
...
@@ -79,7 +79,7 @@ build:ubuntu_bionic_pkg:
script
:
-
cmake -DINSTALL_LIBAPPIMAGE=On -DINSTALL_ATTICA=On -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .
-
make -j`nproc`
-
cpack -G DEB -G DEB -R 1.0.
1
-ubuntu-bionic
-
cpack -G DEB -G DEB -R 1.0.
2
-ubuntu-bionic
artifacts
:
expire_in
:
1 year
paths
:
...
...
.travis/arch/PKGBUILD
View file @
b4fc9bf5
...
...
@@ -2,7 +2,7 @@
projectname
=
appimage-installer
pkgname
=
appimage-installer
pkgver
=
1.0.
1
pkgver
=
1.0.
2
pkgrel
=
1
epoch
=
pkgdesc
=
"AppImage Installer"
...
...
.travis/debian_buster/build_package.sh
View file @
b4fc9bf5
...
...
@@ -15,4 +15,4 @@ fi
mkdir
docker-build-release
sudo
docker run
-v
${
PWD
}
:/source
-v
${
PWD
}
/docker-build-release:/build
${
DOCKER_IMAGE
}
\
/bin/bash
-c
"cmake -DINSTALL_LIBAPPIMAGE=On -DINSTALL_ATTICA=On -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release /source && make -j
`
nproc
`
&& cpack -G DEB -G DEB -R 1.0.
1
-debian-buster"
/bin/bash
-c
"cmake -DINSTALL_LIBAPPIMAGE=On -DINSTALL_ATTICA=On -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release /source && make -j
`
nproc
`
&& cpack -G DEB -G DEB -R 1.0.
2
-debian-buster"
.travis/ubuntu_bionic/build_package.sh
View file @
b4fc9bf5
...
...
@@ -15,4 +15,4 @@ fi
mkdir
docker-build-release
sudo
docker run
-v
${
PWD
}
:/source
-v
${
PWD
}
/docker-build-release:/build
${
DOCKER_IMAGE
}
\
/bin/bash
-c
"cmake -DINSTALL_LIBAPPIMAGE=On -DINSTALL_ATTICA=On -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release /source && make -j
`
nproc
`
&& cpack -G DEB -R 1.0.
1
-ubuntu-bionic"
/bin/bash
-c
"cmake -DINSTALL_LIBAPPIMAGE=On -DINSTALL_ATTICA=On -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release /source && make -j
`
nproc
`
&& cpack -G DEB -R 1.0.
2
-ubuntu-bionic"
CMakeLists.txt
View file @
b4fc9bf5
cmake_minimum_required
(
VERSION 3.8
)
project
(
appimage-installer VERSION 1.0.
1
)
project
(
appimage-installer VERSION 1.0.
2
)
set
(
CMAKE_CXX_STANDARD 11
)
...
...
cmake/versioning.cmake
View file @
b4fc9bf5
...
...
@@ -4,7 +4,7 @@
set
(
APPIMAGE_INSTALLER_V_MAJOR 1
)
set
(
APPIMAGE_INSTALLER_V_MINOR 0
)
set
(
APPIMAGE_INSTALLER_V_PATCH
1
)
set
(
APPIMAGE_INSTALLER_V_PATCH
2
)
set
(
APPIMAGE_INSTALLER_VERSION
${
APPIMAGE_INSTALLER_V_MAJOR
}
.
${
APPIMAGE_INSTALLER_V_MINOR
}
.
${
APPIMAGE_INSTALLER_V_PATCH
}${
APPIMAGE_INSTALLER_V_SUFFIX
}
)
...
...
src/cli/commands/InstallCommand.cpp
View file @
b4fc9bf5
// system
#include
<fstream>
extern
"C"
{
#include
<sys/ioctl.h>
}
...
...
@@ -94,7 +95,33 @@ void InstallCommand::installAppImage() {
auto
permissions
=
targetFile
.
permissions
();
targetFile
.
setPermissions
(
permissions
|
QFileDevice
::
ReadOwner
|
QFileDevice
::
ExeOwner
);
// integrate with the desktop environment
// Control the installation order by using a tmp folder
QByteArray
real_home
=
qgetenv
(
"HOME"
);
QByteArray
user
=
qgetenv
(
"USER"
);
QByteArray
tmp_home_path
=
"/tmp/appimage-installer-temp-home-"
+
user
;
qputenv
(
"HOME"
,
tmp_home_path
);
int
res
=
libappimage_install
();
qputenv
(
"HOME"
,
real_home
);
QProcess
::
execute
(
"cp -rf "
+
tmp_home_path
+
"/.cache/thumbnails "
+
real_home
+
"/.cache/"
);
QProcess
::
execute
(
"cp -rf "
+
tmp_home_path
+
"/.local/share/icons "
+
real_home
+
"/.local/share/"
);
if
(
QFile
::
exists
(
"/usr/bin/kbuildsycoca5"
))
QProcess
::
execute
(
"kbuildsycoca5 --noincremental "
);
QProcess
::
execute
(
"cp -rf "
+
tmp_home_path
+
"/.local/share/applications "
+
real_home
+
"/.local/share/"
);
QByteArray
result_message
=
res
==
0
?
"Installation completed
\n
"
:
"Installation failed
\n
"
;
showInlineMessage
(
result_message
);
QProcess
::
execute
(
"rm -rf "
+
tmp_home_path
);
emit
executionCompleted
();
}
int
InstallCommand
::
libappimage_install
()
const
{
// integrate with the desktop environment
int
res
=
appimage_register_in_system
(
targetPath
.
toStdString
().
c_str
(),
false
);
// add complementary actions
...
...
@@ -132,18 +159,10 @@ void InstallCommand::installAppImage() {
std
::
ofstream
ofstream
(
desktopFilePath
);
ofstream
<<
entry
;
}
if
(
res
==
0
)
{
showInlineMessage
(
"Installation completed"
);
}
else
{
showInlineMessage
(
"Installation failed"
);
}
out
<<
"
\n
"
;
emit
executionCompleted
();
return
res
;
}
void
InstallCommand
::
handleDownloadFailed
(
const
QString
&
message
)
{
...
...
@@ -207,7 +226,7 @@ void InstallCommand::handleGetDownloadLinkJobFinished(Attica::BaseJob* job) {
startFileDownload
(
download
.
link
());
}
}
else
emit
executionFailed
(
"Unable to resolve the application download link."
);
emit
executionFailed
(
"Unable to resolve the application download link."
);
}
int
InstallCommand
::
askWhichFileDownload
(
const
QList
<
Attica
::
DownloadDescription
>&
compatibleDownloads
)
{
...
...
src/cli/commands/InstallCommand.h
View file @
b4fc9bf5
...
...
@@ -64,4 +64,6 @@ private:
void
startFileDownload
(
const
QUrl
&
downloadLink
);
int
askWhichFileDownload
(
const
QList
<
Attica
::
DownloadDescription
>&
compatibleDownloads
);
int
libappimage_install
()
const
;
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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