How can i validate/verify modification package's registry customization?

%3CLINGO-SUB%20id%3D%22lingo-sub-836640%22%20slang%3D%22en-US%22%3EHow%20can%20i%20validate%2Fverify%20modification%20package's%20registry%20customization%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-836640%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20there%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20exploring%20modification%20packages%20with%20respect%20to%20file%20customization%20as%20well%20registry%20customization.%3C%2FP%3E%3CP%3EI%20could%20make%20samples%20for%20file%20customization%20with%20file%20existence%20scenario%2Cbut%20just%20wondering%20how%20can%20i%20make%20samples%20for%20registry%20customization.%3C%2FP%3E%3CP%3EMy%20expectation%20was%3A%3C%2FP%3E%3CUL%3E%3CLI%3EAdd%20key%20say%20HKCU%5CSoftware%5CSample%5CKey1%20in%20Mainpackage%20registry%26nbsp%3B%3C%2FLI%3E%3CLI%3EAdd%20sample%20application%20which%20can%20read%20registry%20key-value%20existence%20in%20the%20above%20mentioned%20path%3C%2FLI%3E%3CLI%3ECreate%20a%20modification%20package%20with%20a%20value%20for%20Key1%20key%26nbsp%3B%3C%2FLI%3E%3CLI%3EOn%20running%20package%2C%20key%20existence%20message%20should%20come%20from%20the%20sample%20application(It%20is%20written%20in%20that%20way)%3C%2FLI%3E%3CLI%3ESince%20writing%20of%20registry%20key%20would%20be%20private%20per-user%2Cper-app%20i%20couldn't%20see%20this%20value%20been%20written%20to%20system's%20HKCU%20native%20hive.%3C%2FLI%3E%3CLI%3EJust%20curious%20how%20to%20validate%20that%20part%3F%3C%2FLI%3E%3CLI%3EIs%20that%20the%20only%20way%20i.e%20reading%20the%20current%20directory's%20User.dat%2FUserClass.dat%20and%20check%20the%20key%20existence%3F%3C%2FLI%3E%3CLI%3EOne%20more%20question%3Afrom%20this%20link%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fdesktop%2Fdesktop-to-uwp-behind-the-scenes%23registry%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fdesktop%2Fdesktop-to-uwp-behind-the-scenes%23registry%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%22%3C%2FP%3E%3CP%3EOnly%20keys%20under%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3EHKLM%5CSoftware%3C%2FEM%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eare%20part%20of%20the%20package%3B%20keys%20under%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3EHKCU%3C%2FEM%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eor%20other%20parts%20of%20the%20registry%20are%20not.%20Writes%20to%20keys%20or%20values%20in%20the%20package%20are%20not%20allowed.%20Writes%20to%20keys%20or%20values%20not%20part%20of%20the%20package%20are%20allowed%20as%20long%20as%20the%20user%20has%20permission.%3C%2FP%3E%3CP%3EAll%20writes%20under%20HKCU%20are%20copy-on-written%20to%20a%20private%20per-user%2C%20per-app%20location.%20Traditionally%2C%20uninstallers%20are%20unable%20to%20clean%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3EHKEY_CURRENT_USER%3C%2FEM%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ebecause%20the%20registry%20data%20for%20logged%20out%20users%20is%20unmounted%20and%20unavailable.%22%3C%2FP%3E%3CUL%3E%3CLI%3ECan%20you%20please%20elaborate%20a%20bit%3F%2CCan%20i%20write%20entries%20to%20HKLM%20too%20in%20modification%20package%3F%3C%2FLI%3E%3CLI%3E%22Writes%20to%20keys%20or%20values%20not%20part%20of%20the%20package%20are%20allowed%20as%20long%20as%20the%20user%20has%20permission.%22%20what%20does%20this%20exactly%20mean%3F%3C%2FLI%3E%3C%2FUL%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EJenifer%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-841937%22%20slang%3D%22en-US%22%3ERe%3A%20How%20can%20i%20validate%2Fverify%20modification%20package's%20registry%20customization%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-841937%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F153639%22%20target%3D%22_blank%22%3E%40Jenifer%20Rajendren%3C%2FA%3E%2C%20a%20great%20resource%20is%20this%20article%20here%26nbsp%3B%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fmanage%2Ftroubleshoot-msix-container%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fmanage%2Ftroubleshoot-msix-container%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20walks%20through%26nbsp%3B%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20%23ffffff%3B%20color%3A%20%23000000%3B%20font-family%3A%20Segoe%20UI%2CSegoeUI%2CSegoe%20WP%2CHelvetica%20Neue%2CHelvetica%2CTahoma%2CArial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20overflow-wrap%3A%20break-word%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3Ehow%20you%20can%20troubleshoot%20runtime%20issues%20occurring%20in%20a%20MSIX%20container%2C%20which%20include%20the%20registry.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hello there,

 

I was exploring modification packages with respect to file customization as well registry customization.

I could make samples for file customization with file existence scenario,but just wondering how can i make samples for registry customization.

My expectation was:

  • Add key say HKCU\Software\Sample\Key1 in Mainpackage registry 
  • Add sample application which can read registry key-value existence in the above mentioned path
  • Create a modification package with a value for Key1 key 
  • On running package, key existence message should come from the sample application(It is written in that way)
  • Since writing of registry key would be private per-user,per-app i couldn't see this value been written to system's HKCU native hive.
  • Just curious how to validate that part?
  • Is that the only way i.e reading the current directory's User.dat/UserClass.dat and check the key existence?
  • One more question:from this link https://docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-scenes#registry 

"

Only keys under HKLM\Software are part of the package; keys under HKCU or other parts of the registry are not. Writes to keys or values in the package are not allowed. Writes to keys or values not part of the package are allowed as long as the user has permission.

All writes under HKCU are copy-on-written to a private per-user, per-app location. Traditionally, uninstallers are unable to clean HKEY_CURRENT_USER because the registry data for logged out users is unmounted and unavailable."

  • Can you please elaborate a bit?,Can i write entries to HKLM too in modification package?
  • "Writes to keys or values not part of the package are allowed as long as the user has permission." what does this exactly mean?

Thanks,

Jenifer

1 Reply
Highlighted

@Jenifer Rajendren, a great resource is this article here https://docs.microsoft.com/en-us/windows/msix/manage/troubleshoot-msix-container

 

It walks through how you can troubleshoot runtime issues occurring in a MSIX container, which include the registry.