Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c98290b

Browse files
committed
Fixes UI labels and ability to add/remove features.
1 parent 102f72c commit c98290b

1 file changed

Lines changed: 21 additions & 10 deletions

File tree

Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,11 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
723723
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Skipping package: %ls, after restart because it was applied before the restart.", wzPackageId);
724724

725725
*pRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE;
726+
} else if ((_plannedAction == BOOTSTRAPPER_ACTION_INSTALL || _plannedAction == BOOTSTRAPPER_ACTION_MODIFY) &&
727+
SUCCEEDED(BalInfoFindPackageById(&_bundle.packages, wzPackageId, &pPackage))) {
728+
BOOL f = FALSE;
729+
if (SUCCEEDED(_engine->EvaluateCondition(pPackage->sczInstallCondition, &f)) && f) {
730+
*pRequestState = BOOTSTRAPPER_REQUEST_STATE_PRESENT;
726731
}
727732
}
728733

@@ -1233,10 +1238,11 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
12331238

12341239
hr = LoadBootstrapperBAFunctions();
12351240
BalExitOnFailure(hr, "Failed to load bootstrapper functions.");
1241+
hr = UpdateUIStrings(_command.action);
1242+
BalExitOnFailure(hr, "Failed to load UI strings.");
12361243

12371244
GetBundleFileVersion();
12381245
// don't fail if we couldn't get the version info; best-effort only
1239-
12401246
LExit:
12411247
ReleaseObject(pixdManifest);
12421248
ReleaseStr(sczModulePath);
@@ -1835,18 +1841,10 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
18351841

18361842
return;
18371843
}
1838-
1839-
1840-
//
1841-
// OnPlan - plan the detected changes.
1842-
//
1843-
void OnPlan(__in BOOTSTRAPPER_ACTION action) {
1844+
HRESULT UpdateUIStrings(__in BOOTSTRAPPER_ACTION action) {
18441845
HRESULT hr = S_OK;
18451846
LPCWSTR likeInstalling = nullptr;
18461847
LPCWSTR likeInstallation = nullptr;
1847-
1848-
_plannedAction = action;
1849-
18501848
switch (action) {
18511849
case BOOTSTRAPPER_ACTION_INSTALL:
18521850
likeInstalling = L"Installing";
@@ -1895,6 +1893,19 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
18951893
SUCCEEDED(hr) && locText ? locText->wzText : likeInstallation
18961894
);
18971895
}
1896+
return hr;
1897+
}
1898+
1899+
//
1900+
// OnPlan - plan the detected changes.
1901+
//
1902+
void OnPlan(__in BOOTSTRAPPER_ACTION action) {
1903+
HRESULT hr = S_OK;
1904+
1905+
_plannedAction = action;
1906+
1907+
hr = UpdateUIStrings(action);
1908+
BalExitOnFailure(hr, "Failed to update strings");
18981909

18991910
// If we are going to apply a downgrade, bail.
19001911
if (_downgrading && BOOTSTRAPPER_ACTION_UNINSTALL < action) {

0 commit comments

Comments
 (0)