17#if !defined(C09CDC45E4B649EDA745DAF436D18309)
18#if defined(MIKTEX_SETUP_SHARED)
19#define MIKTEXSETUPEXPORT MIKTEXDLLIMPORT
21#define MIKTEXSETUPEXPORT
26#define MIKTEXSETUPCEEAPI(type) MIKTEXSETUPEXPORT type MIKTEXCEECALL
28#define MIKTEX_SETUP_BEGIN_NAMESPACE \
32#define MIKTEX_SETUP_END_NAMESPACE \
42#include <miktex/Configuration/TriState>
44#include <miktex/Util/OptionSet>
45#include <miktex/Util/PathName>
46#include <miktex/Core/Session>
47#include <miktex/Core/TemporaryDirectory>
49#include <miktex/PackageManager/PackageManager>
53MIKTEX_SETUP_BEGIN_NAMESPACE;
60 InstallFromLocalRepository,
61 InstallFromRemoteRepository,
68enum class CleanupOption
82enum class ReportOption
97 AdminUpdateCheckOverdue,
98 UserUpdateCheckOverdue,
99 RootDirectoryCoverage,
105enum class IssueSeverity
116 IssueSeverity severity;
120 MIKTEXSETUPCEEAPI(std::string) GetUrl()
const;
121 MIKTEXSETUPCEEAPI(std::string) ToString()
const;
124inline std::ostream& operator<<(std::ostream& os,
const Issue& issue)
126 return os << issue.ToString();
136 CleanupOptionSet CleanupOptions;
139#if defined(MIKTEX_WINDOWS)
142 bool IsCommonSetup =
false;
143 bool IsDryRun =
false;
145 bool IsPortable =
false;
146 bool IsPrefabricated =
false;
147 bool IsRegisterPathEnabled =
false;
148#if defined(MIKTEX_WINDOWS)
149 bool IsRegistryEnabled =
false;
154 std::string PaperSize =
"A4";
156 std::string RemotePackageRepository;
157 SetupTask Task = SetupTask::None;
200 virtual void MIKTEXTHISCALL
ReportLine(
const std::string& str) = 0;
306 bool cancelled =
false;
318 virtual
void MIKTEXTHISCALL Initialize() = 0;
321 virtual
void MIKTEXTHISCALL OpenLog() = 0;
322 virtual MiKTeX::
Util::PathName MIKTEXTHISCALL CloseLog(
bool cancel) = 0;
323 virtual
void MIKTEXTHISCALL Log(const std::
string& s) = 0;
324 virtual
void MIKTEXTHISCALL ULogOpen() = 0;
325 virtual
void MIKTEXTHISCALL ULogClose() = 0;
326 virtual MiKTeX::
Util::PathName MIKTEXTHISCALL GetULogFileName() = 0;
327 virtual
void ULogAddFile(const MiKTeX::
Util::PathName& path) = 0;
328 virtual
void MIKTEXTHISCALL SetCallbacks(std::function<
void(const std::
string&)> f_ReportLine, std::function<
bool(const std::
string&)> f_OnRetryableError, std::function<
bool(MiKTeX::
Setup::
Notification)> f_OnProgress, std::function<
bool(const
void*,
size_t)> f_OnProcessOutput) = 0;
329 virtual
void MIKTEXTHISCALL Run() = 0;
330 virtual
void MIKTEXTHISCALL WriteReport(std::ostream& s, ReportOptionSet options) = 0;
331 virtual
void MIKTEXTHISCALL WriteReport(std::ostream& s) = 0;
332 virtual
void MIKTEXTHISCALL CollectDiagnosticInfo(const MiKTeX::
Util::PathName& outputFileName) = 0;
333 virtual std::vector<
Issue> MIKTEXTHISCALL FindIssues(
bool checkPath,
bool checkPackageIntegrity) = 0;
334 virtual std::vector<
Issue> MIKTEXTHISCALL GetIssues() = 0;
336#if defined(MIKTEX_WINDOWS)
337 virtual void MIKTEXTHISCALL CreateProgramIcons() = 0;
338 virtual void ULogAddRegValue(HKEY hkey,
const std::string& valueName,
const std::string& value) = 0;
341 static MIKTEXSETUPCEEAPI(std::unique_ptr<SetupService>) Create();
342 static MIKTEXSETUPCEEAPI(std::unique_ptr<MiKTeX::Core::TemporaryDirectory>) CreateSandbox(
MiKTeX::Core::StartupConfig& startupConfig);
350 static MIKTEXSETUPCEEAPI(std::unique_ptr<MiKTeX::Core::TemporaryDirectory>) ExtractFiles();
353MIKTEX_SETUP_END_NAMESPACE;
355#undef MIKTEX_SETUP_BEGIN_NAMESPACE
356#undef MIKTEX_SETUP_END_NAMESPACE
TriState
Tri-state enum class.
Definition TriState.h:22
@ Undetermined
Undetermined.
Definition TriState.h:28
Callback interface.
Definition SetupService.h:193
virtual bool OnRetryableError(const std::string &message)=0
virtual void ReportLine(const std::string &str)=0
virtual bool OnProgress(Notification nf)=0
virtual bool OnProcessOutput(const void *output, size_t n)=0
Definition SetupService.h:224
virtual ProgressInfo GetProgressInfo()=0
Gets progress information.
virtual void SetCallback(SetupServiceCallback *callback)=0
Definition OptionSet.h:26
Instances of this class can be used to store path names.
Definition PathName.h:64
PackageLevel
Package level.
Definition RepositoryInfo.h:40
Notification
Notification enum class.
Definition SetupService.h:164
@ RemoveFileStart
File removal is about to start.
Definition SetupService.h:179
@ InstallFileStart
File installation is about to start.
Definition SetupService.h:171
@ DownloadPackageEnd
Package download has finished.
Definition SetupService.h:169
@ RemoveFileEnd
File removal has finished.
Definition SetupService.h:181
@ DownloadPackageStart
Package download is about to start.
Definition SetupService.h:167
@ RemovePackageEnd
Package removal has finished.
Definition SetupService.h:185
@ InstallPackageStart
Package installation is about to start.
Definition SetupService.h:175
@ RemovePackageStart
Package removal is about to start.
Definition SetupService.h:183
@ InstallPackageEnd
Package installation has finished.
Definition SetupService.h:177
@ InstallFileEnd
File installation has finished.
Definition SetupService.h:173
Generic utilities.
Definition CharBuffer.h:26
Startup configuration.
Definition Session.h:124
Definition SetupService.h:114
Definition SetupService.h:131
Progress info struct.
Definition SetupService.h:230
unsigned long cFilesInstallTotal
Number of files to be installed.
Definition SetupService.h:274
size_t cbPackageInstallTotal
Number of bytes to be written (current package).
Definition SetupService.h:286
unsigned long cFilesRemoveCompleted
Number of removed files.
Definition SetupService.h:241
unsigned numErrors
Number of errors.
Definition SetupService.h:304
size_t cbInstallCompleted
Number of bytes written.
Definition SetupService.h:289
unsigned long cFilesPackageInstallTotal
Number of files to be installed (current package).
Definition SetupService.h:268
unsigned long cPackagesInstallTotal
Number of packages to be installed.
Definition SetupService.h:280
unsigned long bytesPerSecond
Current transfer speed.
Definition SetupService.h:295
size_t cbPackageDownloadTotal
Number of bytes to be received (current package).
Definition SetupService.h:256
size_t cbPackageInstallCompleted
Number of written bytes (current package).
Definition SetupService.h:283
size_t cbInstallTotal
Number of bytes to be written.
Definition SetupService.h:292
size_t cbDownloadCompleted
Number of bytes received.
Definition SetupService.h:259
std::string packageId
Package ID.
Definition SetupService.h:232
MiKTeX::Util::PathName fileName
Path name of current file.
Definition SetupService.h:238
size_t cbDownloadTotal
Number of bytes to be received.
Definition SetupService.h:262
unsigned long cFilesInstallCompleted
Number of installed files.
Definition SetupService.h:271
size_t cbPackageDownloadCompleted
Number of received bytes (current package).
Definition SetupService.h:253
size_t cFilesPackageInstallCompleted
Number of installed files (current package).
Definition SetupService.h:265
unsigned long cPackagesRemoveTotal
Number of packages to be removed.
Definition SetupService.h:250
std::string displayName
Display name of package.
Definition SetupService.h:235
unsigned long cPackagesRemoveCompleted
Number of removed packages.
Definition SetupService.h:247
unsigned long cFilesRemoveTotal
Number of files to be removed.
Definition SetupService.h:244
bool ready
Ready flag.
Definition SetupService.h:301
unsigned long timeRemaining
estimated time of arrival (millisecs remaining).
Definition SetupService.h:298
unsigned long cPackagesInstallCompleted
Number of installed packages.
Definition SetupService.h:277