Skip to content

Commit

Permalink
Use UIBase utility to open file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Aug 9, 2024
1 parent 24bcc78 commit baa508a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/installer_manual_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>InstallerManual</name>
<message>
<location filename="installermanual.cpp" line="52"/>
<location filename="installermanual.cpp" line="50"/>
<source>Manual Installer</source>
<translation type="unfinished"></translation>
</message>
Expand Down
15 changes: 1 addition & 14 deletions src/installermanual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QDialog>
#include <QtPlugin>

#include <Shellapi.h>

#include <uibase/game_features/igamefeatures.h>
#include <uibase/game_features/moddatachecker.h>
#include <uibase/iinstallationmanager.h>
Expand Down Expand Up @@ -75,18 +73,7 @@ bool InstallerManual::isArchiveSupported(std::shared_ptr<const MOBase::IFileTree
void InstallerManual::openFile(const FileTreeEntry* entry)
{
QString tempName = manager()->extractFile(entry->shared_from_this());

SHELLEXECUTEINFOW execInfo;
memset(&execInfo, 0, sizeof(SHELLEXECUTEINFOW));
execInfo.cbSize = sizeof(SHELLEXECUTEINFOW);
execInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
execInfo.lpVerb = L"open";
std::wstring fileNameW = ToWString(tempName);
execInfo.lpFile = fileNameW.c_str();
execInfo.nShow = SW_SHOWNORMAL;
if (!::ShellExecuteExW(&execInfo)) {
qCritical("failed to spawn %s: %d", qUtf8Printable(tempName), ::GetLastError());
}
shell::Open(tempName);
}

IPluginInstaller::EInstallResult
Expand Down

0 comments on commit baa508a

Please sign in to comment.