Skip to content

Commit baa508a

Browse files
committed
Use UIBase utility to open file.
1 parent 24bcc78 commit baa508a

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

src/installer_manual_en.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ p, li { white-space: pre-wrap; }
151151
<context>
152152
<name>InstallerManual</name>
153153
<message>
154-
<location filename="installermanual.cpp" line="52"/>
154+
<location filename="installermanual.cpp" line="50"/>
155155
<source>Manual Installer</source>
156156
<translation type="unfinished"></translation>
157157
</message>

src/installermanual.cpp

+1-14
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
2222
#include <QDialog>
2323
#include <QtPlugin>
2424

25-
#include <Shellapi.h>
26-
2725
#include <uibase/game_features/igamefeatures.h>
2826
#include <uibase/game_features/moddatachecker.h>
2927
#include <uibase/iinstallationmanager.h>
@@ -75,18 +73,7 @@ bool InstallerManual::isArchiveSupported(std::shared_ptr<const MOBase::IFileTree
7573
void InstallerManual::openFile(const FileTreeEntry* entry)
7674
{
7775
QString tempName = manager()->extractFile(entry->shared_from_this());
78-
79-
SHELLEXECUTEINFOW execInfo;
80-
memset(&execInfo, 0, sizeof(SHELLEXECUTEINFOW));
81-
execInfo.cbSize = sizeof(SHELLEXECUTEINFOW);
82-
execInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
83-
execInfo.lpVerb = L"open";
84-
std::wstring fileNameW = ToWString(tempName);
85-
execInfo.lpFile = fileNameW.c_str();
86-
execInfo.nShow = SW_SHOWNORMAL;
87-
if (!::ShellExecuteExW(&execInfo)) {
88-
qCritical("failed to spawn %s: %d", qUtf8Printable(tempName), ::GetLastError());
89-
}
76+
shell::Open(tempName);
9077
}
9178

9279
IPluginInstaller::EInstallResult

0 commit comments

Comments
 (0)