SHARE
TWEET

Windows App-Deployment Database modification Script

SoftSonic Nov 6th, 2018 (edited) 1,246 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*#################################################################################################################################*/
  2. /* Windows App-Deployment Database modification Script */
  3. /* Windows 10 Pro 1809 (64-Bit) */
  4. /*#################################################################################################################################*/
  5.  
  6. /* Drop all Package related Triggers to avoid error messages */
  7.  
  8. DROP TRIGGER TRG_AFTERDELETE_Package_Key;
  9. DROP TRIGGER TRG_AFTERINSERT_Package;
  10. DROP TRIGGER TRG_AFTERINSERT_Package_Key;
  11. DROP TRIGGER TRG_AFTERUPDATE_Package__Created_LongRunningTransactionUpdateDuringCommit;
  12. DROP TRIGGER TRG_AFTER_UPDATE_Package_SRJournal;
  13. DROP TRIGGER TRG_BEFOREDELETE_Package_SRJournal;
  14. DROP TRIGGER TRG_IDX_Package_PackageFamily_ResourceId_Architecture_Version__WorkId;
  15.  
  16. /* Alter IsInbox-Values in Package Table for all Packages you want to uninstall to 0 */
  17.  
  18. UPDATE Package SET IsInbox=0 WHERE PackageFullName='InputApp_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy';
  19. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.AAD.BrokerPlugin_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy';
  20. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.ECApp_10.0.17763.1_neutral__8wekyb3d8bbwe';
  21. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.LockApp_10.0.17763.1_neutral__cw5n1h2txyewy';
  22. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.PPIProjection_10.0.17763.1_neutral_neutral_cw5n1h2txyewy';
  23. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.Windows.Apprep.ChxApp_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy';
  24. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.Windows.AssignedAccessLockApp_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy';
  25. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.Windows.ContentDeliveryManager_10.0.17763.1_neutral_neutral_cw5n1h2txyewy';
  26. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.Windows.NarratorQuickStart_10.0.17763.1_neutral_neutral_8wekyb3d8bbwe';
  27. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.Windows.OOBENetworkCaptivePortal_10.0.17763.1_neutral__cw5n1h2txyewy';
  28. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.Windows.OOBENetworkConnectionFlow_10.0.17763.1_neutral__cw5n1h2txyewy';
  29. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.Windows.ParentalControls_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy';
  30. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.Windows.PeopleExperienceHost_10.0.17763.1_neutral_neutral_cw5n1h2txyewy';
  31. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.Windows.SecHealthUI_10.0.17763.1_neutral__cw5n1h2txyewy';
  32. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.Windows.SecureAssessmentBrowser_10.0.17763.1_neutral_neutral_cw5n1h2txyewy';
  33. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.Windows.XGpuEjectDialog_10.0.17763.1_neutral_neutral_cw5n1h2txyewy';
  34. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Microsoft.XboxGameCallableUI_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy';
  35. UPDATE Package SET IsInbox=0 WHERE PackageFullName='Windows.CBSPreview_10.0.17763.1_neutral_neutral_cw5n1h2txyewy';
  36.  
  37. /* Recreate all Package related Triggers */
  38.  
  39. CREATE TRIGGER TRG_AFTERDELETE_Package_Key AFTER DELETE ON Package FOR EACH ROW WHEN is_triggers_enabled() AND OLD._WorkId=0
  40. BEGIN
  41.    UPDATE SEQUENCE SET LastValue=LastValue+1 WHERE Id=1;INSERT OR REPLACE INTO PackageChangelog(_Revision, _WorkId, _Created, _Deleted, PackageFullName, _PackageID, WhenOccurred, _Dictionary)SELECT 1, workid(), OLD._Created, s.LastValue, OLD.PackageFullName, OLD._PackageID, now(), NULL FROM SEQUENCE AS s WHERE s.Id=1;
  42. END;
  43.  
  44. CREATE TRIGGER TRG_AFTERINSERT_Package AFTER INSERT ON Package FOR EACH ROW
  45. BEGIN
  46.    INSERT OR IGNORE INTO PackageIdentity (PackageFamily, PackageFullName) VALUES(NEW.PackageFamily, NEW.PackageFullName);UPDATE SEQUENCE SET LastValue=LastValue+1 WHERE Id=2 ;INSERT INTO SRJournal(_Revision, _WorkId, ObjectType, Action, ObjectId, PackageIdentity, WhenOccurred, SequenceId)SELECT 1, workid(), 1, 1, NEW._PackageID, pi._PackageIdentityID, now(), s.LastValue FROM SEQUENCE AS s CROSS JOIN PackageIdentity AS pi WHERE s.Id=2 AND pi.PackageFullName=NEW.PackageFullName;
  47. END;
  48.  
  49. CREATE TRIGGER TRG_AFTERINSERT_Package_Key AFTER INSERT ON Package FOR EACH ROW WHEN is_triggers_enabled() AND NEW._WorkId=0 AND NEW._Created=0
  50. BEGIN
  51.    DELETE FROM PackageChangelog WHERE NEW._Created=0 AND PackageFullName=NEW.PackageFullName;
  52. END;
  53.  
  54. CREATE TRIGGER TRG_AFTERUPDATE_Package__Created_LongRunningTransactionUpdateDuringCommit AFTER UPDATE OF _Created ON Package FOR EACH ROW WHEN OLD._Created=-2 AND NEW._Created>0
  55. BEGIN
  56.    DELETE FROM PackageChangelog WHERE PackageFullName=NEW.PackageFullName;
  57. END;
  58.  
  59. CREATE TRIGGER TRG_AFTER_UPDATE_Package_SRJournal AFTER UPDATE ON Package FOR EACH ROW
  60. BEGIN
  61.    UPDATE SEQUENCE SET LastValue=LastValue+1 WHERE Id=2 ;INSERT INTO SRJournal(_Revision, _WorkId, ObjectType, Action, ObjectId, PackageIdentity, WhenOccurred, SequenceId)SELECT 1, workid(), 1, 2, NEW._PackageID, pi._PackageIdentityID, now(), s.LastValue FROM SEQUENCE AS s CROSS JOIN PackageIdentity AS pi WHERE s.Id=2 AND pi.PackageFullName=NEW.PackageFullName;
  62. END;
  63.  
  64. CREATE TRIGGER TRG_BEFOREDELETE_Package_SRJournal BEFORE DELETE ON Package FOR EACH ROW
  65. BEGIN
  66.    UPDATE SEQUENCE SET LastValue=LastValue+1 WHERE Id=2 ;INSERT INTO SRJournal(_Revision, _WorkId, ObjectType, Action, ObjectId, PackageIdentity, WhenOccurred, SequenceId)SELECT 1, workid(), 1, 3, OLD._PackageID, pi._PackageIdentityID, now(), s.LastValue FROM SEQUENCE AS s CROSS JOIN PackageIdentity AS pi WHERE s.Id=2 AND pi.PackageFullName=OLD.PackageFullName;
  67. END;
  68.  
  69. CREATE TRIGGER TRG_IDX_Package_PackageFamily_ResourceId_Architecture_Version__WorkId BEFORE INSERT ON Package FOR EACH ROW
  70. BEGIN
  71.    SELECT CASE WHEN ((SELECT _PackageID FROM Package WHERE PackageFamily=NEW.PackageFamily AND ResourceId IS NEW.ResourceId AND Architecture=NEW.Architecture AND Version=NEW.Version AND _WorkId=NEW._WorkId) IS NOT NULL)THEN RAISE(ABORT, 'INSERT INTO "Package" violates the unique index "IDX_Package_PackageFamily_ResourceId_Architecture_Version__WorkId"') END;
  72. END;
  73.  
  74. /*#################################################################################################################################*/
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top