mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2025-02-22 11:01:10 +00:00
Avoid checking for existence of package when installing symlinks
Only check for the existence of the package for regular files
This commit is contained in:
parent
be8d6cbc87
commit
dc303201fa
2 changed files with 12 additions and 6 deletions
|
@ -172,15 +172,9 @@ void UpdateInstaller::revert()
|
|||
|
||||
void UpdateInstaller::installFile(const UpdateScriptFile& file)
|
||||
{
|
||||
std::string packageFile = m_packageDir + '/' + file.package + ".zip";
|
||||
std::string destPath = m_installDir + '/' + file.path;
|
||||
std::string target = file.linkTarget;
|
||||
|
||||
if (!FileOps::fileExists(packageFile.c_str()))
|
||||
{
|
||||
throw "Package file does not exist: " + packageFile;
|
||||
}
|
||||
|
||||
// backup the existing file if any
|
||||
backupFile(destPath);
|
||||
|
||||
|
@ -193,6 +187,13 @@ void UpdateInstaller::installFile(const UpdateScriptFile& file)
|
|||
|
||||
if (target.empty())
|
||||
{
|
||||
// locate the package containing the file
|
||||
std::string packageFile = m_packageDir + '/' + file.package + ".zip";
|
||||
if (!FileOps::fileExists(packageFile.c_str()))
|
||||
{
|
||||
throw "Package file does not exist: " + packageFile;
|
||||
}
|
||||
|
||||
// extract the file from the package and copy it to
|
||||
// the destination
|
||||
FileOps::extractFromZip(packageFile.c_str(),file.path.c_str(),destPath.c_str());
|
||||
|
|
|
@ -23,6 +23,11 @@
|
|||
<permissions>30549</permissions>
|
||||
<package>app-pkg</package>
|
||||
</file>
|
||||
<!-- Test symlink !-->
|
||||
<file>
|
||||
<name>test-dir/app-symlink</name>
|
||||
<target>../app</target>
|
||||
</file>
|
||||
</install>
|
||||
<uninstall>
|
||||
<!-- TODO - List some files to uninstall here !-->
|
||||
|
|
Loading…
Reference in a new issue