Imagine that an end user finds that a favorite app has suddenly disappeared from their UI. They’re confused. They subscribed to the app, and now they can’t see it. One reason this could happen: the app is undergoing maintenance, and the admin has temporarily disabled it.

You can make the user aware of the problem without IT intervention. But first, let’s understand why it happens.

If a published app/desktop is disabled, Citrix Workspace (formerly Citrix Receiver) or Receiver for Web hides those apps in the UI. This behavior comes from X1; stores without X1 will show the apps.

Here’s a customization that will help with showing disabled apps in the X1 UI. Just add the following code snippet to script.js in the custom folder for the Receiver for Web site (typically C:\inetpub\wwwroot\Citrix\StoreWeb\custom\) you would like to customize:


CTXS.Extensions.includeApp = function(app) {
if (app.disabled == true) {
// Note down app names and do any customization later on.
}
return true;
}


CTXS.Extensions.doLaunch = function(app,launchFn) {
if (app.disabled == true) {
CTXS.ExtensionAPI.showMessage({
messageTitle: "Cannot Launch: " + app.name,
messageText: "Application is undergoing maintenance!",
okButtonText: "Ok"
});
return; // prevent launch
}
// allow launch
launchFn();
};


CTXS.Extensions.doSubscribe = function(app,subscribeFn) {
if (app.disabled == true) {
CTXS.ExtensionAPI.showMessage({
messageTitle: "Cannot add as favorite: " + app.name,
messageText: "Application is undergoing maintenance!",
okButtonText: "Ok"
});
return; // prevent subscribe
}
// allow subscribe.
subscribeFn();
};


CTXS.Extensions.doRemove = function(app,removeFn) {
if (app.disabled == true) {
CTXS.ExtensionAPI.showMessage({
messageTitle: "Cannot remove as favorite: " + app.name,
messageText: "Application is undergoing maintenance!",
okButtonText: "Ok"
});
return; // prevent remove
}
// allow removal.
removeFn();
};

I’ll explain each part. You can refer to the API documentation for more details.

includeApp:
This is called to know whether an app needs to be shown and happens when the UI tries to enumerate resources. Although the code seems to be doing nothing, it actually returns true for all apps and shows the disabled apps. You can note apps for CSS customization if you want. This is all you need, but we will do other pieces, as well, to improve error messaging.

doLaunch:
This is called when the user clicks on an app. We first check if the app is disabled. If it is, we show a message that app is undergoing maintenance. Then we return without calling the launch function. If you do not prevent the launch, the user will see a “cannot start app/desktop” error and will not know why it cannot start.

doSubscribe:
This is called when the user tries to favorite/subscribe to an app. We follow the same pattern that we did with launch and show a message that the user cannot subscribe at this time.

doRemove:
This is called when the user tries to unsubscribe from an app. Again, we follow the same pattern of displaying a message.

Of course, you can hide messages and use CSS customization to show the app differently. But this customization provides you with a good starting point.