SHO_GuN Posted February 26, 2011 Share Posted February 26, 2011 Hi,I am trying to create a registry entry in the AddReg section that will use the currently logged in user's username.I thought I had it figured out using "HKCU,"Software\MyProgram\MyDirectory","PATH",0x0,"%53%\TargetDirectory".When I run this inf from my desktop, the entry is created as "C:\Documents and Settings\MYUSERNAME\TargetDirectory", just as I want.However, when I use that line in my addon during Windows install, the entry is created as "C:\Documents and Settings\Default User\TargetDirectory" - Instead of "MYUSERNAME", it is showing up as "Default User" and the application does not work.Could someone give me a hint as to how to accomplish this, I have searched to no avail.Thanks - Gun Quote Link to comment Share on other sites More sharing options...
ricktendo Posted February 26, 2011 Share Posted February 26, 2011 Depends when you call it, if you do it during setup the Default User is the user account, if you delay it to run during 1st login with RunOnceEx it will use that user instead Quote Link to comment Share on other sites More sharing options...
SHO_GuN Posted February 26, 2011 Author Share Posted February 26, 2011 (edited) Thanks - that was the nudge I needed, got it figured out now :thumbsup_anim:Edit: Was happy too soon - worked fine from desktop, run addon via inf, reboot and reg entry correctly created. Was a different story on a live install, still was created as "Default User". Oh well, I will stick with adding it via my first boot reg tweaks.Edit #2: Got it worked out this morning .. a little convoluted but it works. Instead of running the desired reg entry on first reboot, I added another runonceex at first reboot that makes the desired entry on second reboot. Edited February 27, 2011 by SHO_GuN Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.