Jump to content











Photo
- - - - -

offlinereg


  • Please log in to reply
314 replies to this topic

#126 misty

misty

    Gold Member

  • Developer
  • 1034 posts
  •  
    United Kingdom

Posted 25 January 2018 - 08:14 PM



Current process when nobackup is specified -
saved to D:\PATH\System.new ok
renamed D:\PATH\System to D:\PATH\System.old
renamed D:\PATH\System.new to D:\PATH\System
How about -
saved to D:\PATH\System.new ok
deleted D:\PATH\System 
renamed D:\PATH\System.new to D:\PATH\System
At the moment I'm assuming that when multiple commands are executed any System.old is deleted anyway?

If you are taking requests, then how about parsing a listfile for multiple commands and then executing the orsavehive command when all operations have finished? It could be similar to the existing import command, but with a list of commands instead of a reg file.

Misty
  • Atari800XL likes this

#127 misty

misty

    Gold Member

  • Developer
  • 1034 posts
  •  
    United Kingdom

Posted 25 January 2018 - 08:19 PM

BTW, this is fun. It feels like being an active part of development....

...with someone else doing all of the hard work! :whistling:

Many thanks Erwan :worship:

And thanks also to Wonko for opening this discussion up. :starwars:

#128 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2823 posts
  • Location:Nantes - France
  •  
    France

Posted 25 January 2018 - 08:26 PM

EDIT - forgot to mention that the above commands all appear to have worked fine and all keys were present and correct when the new hive was mounted and viewed in the Registry Editor.


:cheers:

Misty
 

 

Looks good :) 

Thanks for this quick tests.

 

Offlinereg is very verbose (as pointed by Wonko already), I will review that shortly.

I am waiting a bit thus to see how the discussion goes around the nobackup parameter (and taking into consideration this post).

 

I am sure we will shortly and collectively find a balanced solution !



#129 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2823 posts
  • Location:Nantes - France
  •  
    France

Posted 25 January 2018 - 08:28 PM

Current process when nobackup is specified -

saved to D:\PATH\System.new ok
renamed D:\PATH\System to D:\PATH\System.old
renamed D:\PATH\System.new to D:\PATH\System
How about -
saved to D:\PATH\System.new ok
deleted D:\PATH\System 
renamed D:\PATH\System.new to D:\PATH\System
At the moment I'm assuming that when multiple commands are executed any System.old is deleted anyway?

If you are taking requests, then how about parsing a listfile for multiple commands and then executing the orsavehive command when all operations have finished? It could be similar to the existing import command, but with a list of commands instead of a reg file.

Misty

 

 

Consider the new wording done (in a few mns !).

 

Your second idea is very good ! I will most probably implement it.


  • Atari800XL likes this

#130 misty

misty

    Gold Member

  • Developer
  • 1034 posts
  •  
    United Kingdom

Posted 25 January 2018 - 08:29 PM

...Now what I can do is perform this task by default and leave it up to the "batcher" to eventually backup the file before any operation....

That gets my vote :thumbsup:



#131 misty

misty

    Gold Member

  • Developer
  • 1034 posts
  •  
    United Kingdom

Posted 25 January 2018 - 08:32 PM

Consider the new wording done (in a few mns !).
 
Your second idea is very good ! I will most probably implement it.


I'm full of good ideas. Sadly I lack the skills to implement them!

Please take your time Erwan - there are a lot of requests flying around at the moment and this is only one of many projects you have developed.

#132 Atari800XL

Atari800XL

    Frequent Member

  • Advanced user
  • 117 posts
  •  
    Netherlands

Posted 25 January 2018 - 08:34 PM

"My" current 64bit version is already super excellent, but a Listfile for operations as mentioned by Misty, would be awesome!

 

(I'm not very excited by the environment variable for overwrites, to be honest, but will not complain if you decide to use this.)



#133 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15153 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 25 January 2018 - 09:01 PM

There is (yet another) possibility (though very likely it is is a PITA to modify the program :unsure:)

 

Have it behave more or less *like* DISKPART, i.e. spawn a "different" command line if used with no parameters.

 

This way, each time OfflineReg is launched (without any parameter/command if not the path to the registry file) it enters its own console and does create a backup file, before *any* internal command is executed.

 

This backup is then renamed to the original file (thus overwriting it) ONLY if the user confirms. i.e. after typing in the internal console quit or exit, a confirmation dialog is shown.

 

The batcher can use the same tricks currently used for diskpart (besides the possibility of using a script with /s) involving piping to it.

 

It seems to me way overkill, though. :dubbio:

 

 

Maybe (yet another approach) a final command "commit" would be the easiest.

 

I.e. when you start offlinereg.exe, no matter with which command, you automatically create the (needed) backup file adding to the original filename (and extension) a given "proprietary" extension, as an example ".orf" IF such file does not already exist.

Once (or IF) it already exists, then ALL "read" like request are done to the .orf file, no matter if the request is for the original file or for the .orf, and all "write" like request are as well performed to the .orf file.

 

At the end of use of the offlinereg, the user can choose to either:

1) do nothing, the original file remains unchanged and the .orf file is the only modified file

2) issue an  "offlinereg.exe TARGET commit"  command and have the .orf file renamed to the original (thus overwriting it)

 

Offlinereg.exe could, when started check the date/time stamp of a possibly leftover .orf and - if the file is older than - say - 5 minutes consider it a "previous session leftover" , rename the .orf file to .orfold1 (if orfold1 exists .orfold2, etc.) and proceed to create a new "temporary" .orf file for the "current session".

 

But maybe this is also too complex. :unsure:

 

:duff:

jaclaz



#134 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2823 posts
  • Location:Nantes - France
  •  
    France

Posted 25 January 2018 - 09:05 PM

thinking loud :

 

-i could make a copy in the windows temp folder

-work on this copy

-by default overwrite the original file

 

more efficient than currently :

-open original

-save to new (always)

-rename original to old

-rename new to original

 

EDIT : just seen Wonko latest post (posted during me writing...) - need to process it.

 

Because I like multi tasking, i am also 50% done with having offlinereg parse a "listfile" :)



#135 darren rose

darren rose

    Frequent Member

  • Advanced user
  • 448 posts
  • Location:Norwich, Norfolk
  •  
    United Kingdom

Posted 25 January 2018 - 09:14 PM

@erwan.l

 

I like that idea e.g. using windows temp folder

 

@wonko

 

That sounds to me at least a bit overcomplicated

 

@All

 

I basically would just like it not to create a backup unless I tell it to - so I then don't have to worry about renaming files, moving files, deleting files - it simply makes my registry changes and updates the original registry file



#136 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2823 posts
  • Location:Nantes - France
  •  
    France

Posted 25 January 2018 - 09:21 PM

Highly (really) experimental : new command offlinereg TEMPREG.DAT " " run commands.txt.

 

The hive is saved (orsavehive) only after the last command.

Adding the "soon to disappear" / infamous nobackup param should work as well.

 

commands.txt looks like :

" " create
A\B\C\D\E\Test setvalue NewValue NewValueData 1 
A\B\C\D\E\Test setvalue "New Value" "New Value Data" 1 
A\B\C\D\E\Test setvalue ThreadingModel Both 1 
A\B\C\D\E\Test setvalue " " %%SystemRoot%%\System32\actxprxy.dll 2 
A\B\C\D\E\Test setvalue "Reg Binary Test" 80,00,00,00,00,00,00,00 3 
A\B\C\D\E\Test setvalue BootDriverFlags2 28 4 
A\B\C\D\E\Test setvalue PreshutdownOrder "wuauserv gpsvc trustedinstaller" 7 


#137 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2823 posts
  • Location:Nantes - France
  •  
    France

Posted 25 January 2018 - 09:24 PM

@erwan.l

 

I like that idea e.g. using windows temp folder

 

 

I will probably go for that tomorrow and leave the responsibility of backuping to the batcher.



#138 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2823 posts
  • Location:Nantes - France
  •  
    France

Posted 25 January 2018 - 09:27 PM

And now time "to go dark" !



#139 misty

misty

    Gold Member

  • Developer
  • 1034 posts
  •  
    United Kingdom

Posted 25 January 2018 - 09:36 PM

Highly (really) experimental : new command offlinereg TEMPREG.DAT " " run commands.txt.
 
The hive is saved (orsavehive) only after the last command.
Adding the "soon to disappear" / infamous nobackup param should work as well.
 
commands.txt looks like :


" " create
A\B\C\D\E\Test setvalue NewValue NewValueData 1 
A\B\C\D\E\Test setvalue "New Value" "New Value Data" 1 
A\B\C\D\E\Test setvalue ThreadingModel Both 1 
A\B\C\D\E\Test setvalue " " %%SystemRoot%%\System32\actxprxy.dll 2 
A\B\C\D\E\Test setvalue "Reg Binary Test" 80,00,00,00,00,00,00,00 3 
A\B\C\D\E\Test setvalue BootDriverFlags2 28 4 
A\B\C\D\E\Test setvalue PreshutdownOrder "wuauserv gpsvc trustedinstaller" 7 

I did a quick test. Only the last command in the list (setvalue PreshutdownOrder...) was executed.

Removed the last line and tried again. Only the (new) last line (setvalue BootDriverFlags2...) was executed.

Very fast work though. Can't wait to see how it turns out.

And now it is time for me to "go dark" too. Night, night all.

#140 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15153 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 January 2018 - 09:43 AM

 

:duff:

Wonko



#141 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2823 posts
  • Location:Nantes - France
  •  
    France

Posted 26 January 2018 - 11:20 AM

I did a quick test. Only the last command in the list (setvalue PreshutdownOrder...) was executed.

Removed the last line and tried again. Only the (new) last line (setvalue BootDriverFlags2...) was executed.

Very fast work though. Can't wait to see how it turns out.

And now it is time for me to "go dark" too. Night, night all.

 

Ok nice catch.

Issue found and fixed.

New zip uploaded.

 

Now works fine on my side : will need some testing thus as I dont do much error checking for now.

 

Will now work on removing this nobacku param and it will be be version 1.0.0 :)

 

U18L6aN.png


  • Atari800XL likes this

#142 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2823 posts
  • Location:Nantes - France
  •  
    France

Posted 26 January 2018 - 11:45 AM

version 1.0.0 uploaded.

 

latest changes.

0.9.9
added : import will support the @ i.e default value syntax
added : multi level path are handled by createkey and setvalue (i.e the full path will be created)
added : param after createkey can be empty
added : param after deletekey can be empty
added : new param run

1.0.0
removed : no more nobackup param - will overwrite original file

  • Atari800XL and misty like this

#143 Atari800XL

Atari800XL

    Frequent Member

  • Advanced user
  • 117 posts
  •  
    Netherlands

Posted 26 January 2018 - 12:31 PM

 

Highly (really) experimental : new command offlinereg TEMPREG.DAT " " run commands.txt.


You're using " " after TEMPREG.DAT, does this mean that the registry paths in "commands.txt" are relative to this "starting" path? So the "home" path in the command line is added to the path in commands.txt? Or is it better to always start in " " ('home')?

I'm preparing my commands.txt now, will test in a few hours. Thanks again for your excellent work!!

[EDIT: Couldn't resist a quick (and dangerous) test: Working GREAT (x64 version), and using a "commands.txt" is FAST!! - will detail test later]

Edited by Atari800XL, 26 January 2018 - 12:40 PM.


#144 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2823 posts
  • Location:Nantes - France
  •  
    France

Posted 26 January 2018 - 01:04 PM

 

You're using " " after TEMPREG.DAT, does this mean that the registry paths in "commands.txt" are relative to this "starting" path? So the "home" path in the command line is added to the path in commands.txt? Or is it better to always start in " " ('home')?

I'm preparing my commands.txt now, will test in a few hours. Thanks again for your excellent work!!

[EDIT: Couldn't resist a quick (and dangerous) test: Working GREAT (x64 version), and using a "commands.txt" is FAST!! - will detail test later]

 

Syntax is OfflineReg HIVE PATH VERB [SOURCE|[VALUE][TYPE]].

 

Path is always an absolute path starting from the root of the hive.

Source is always a relative path starting from the root of specified path.

 

I have designed the run command to work with absolute path.

Now looking twice at my code, I would not be surprised that if you replace the " " by a path, it will actually work : test it? :)

 

Same question/request was made a few posts ago (by Wonko) actually for the import command.

First I should "harmonize" the syntax.

Currently it   is OfflineReg "c:\temp\system" a_reg_file import which is not consistent with OfflineReg "c:\temp\system" " " run commands.txt.

The second parameter should always be a path or " ".

I should rewrite this command to be   OfflineReg "c:\temp\system" " " import a_reg_file which will allow later on to eventually handle relative path in the reg file.

 

About the above thus, these reg file are generated by regedit and I am not sure under which scenario one would end up with relative paths in such a reg file?



#145 misty

misty

    Gold Member

  • Developer
  • 1034 posts
  •  
    United Kingdom

Posted 26 January 2018 - 01:12 PM

version 1.0.0 uploaded.
 
latest changes.


0.9.9
added : import will support the @ i.e default value syntax
added : multi level path are handled by createkey and setvalue (i.e the full path will be created)
added : param after createkey can be empty
added : param after deletekey can be empty
added : new param run

1.0.0
removed : no more nobackup param - will overwrite original file

Great work. I look forward to playing with it properly over the weekend. I did a quick test and the new run command worked well (just 32-bit version tested). A great addition to OfflineReg.

Just out of curiosity, how are the save operations implemented now? I'm referring to the new (and default :thumbsup:) equivalent of the previous nobackup command.

The output in my batch was -
saved to TEMPREG.dat ok
I'm guessing, based on your post yesterday about the orsavehive limitations, that more operations than this are actually being carried out, but are not being reported on the command-line?

:cheers:

Misty

P.s. To quote Wayne and Garth "We are not worthy" :worship:

#146 misty

misty

    Gold Member

  • Developer
  • 1034 posts
  •  
    United Kingdom

Posted 26 January 2018 - 01:16 PM

....About the above thus, these reg file are generated by regedit and I am not sure under which scenario one would end up with relative paths in such a reg file?

I can't think of any for a generated .reg file. Unless it is edited by someone.

Good luck with implementing import. I suspect that it will be a right pain in the A***! There is also the high likelihood that people will be attempting to use .reg files with settings for multiple hives.

BTW, I will work on updating the guide over the weekend.

P.s. Thank you as always for all of your hard work. This has been great fun so far.

#147 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2823 posts
  • Location:Nantes - France
  •  
    France

Posted 26 January 2018 - 01:29 PM


Just out of curiosity, how are the save operations implemented now? I'm referring to the new (and default :thumbsup:) equivalent of the previous nobackup command.

The output in my batch was -

saved to TEMPREG.dat ok
I'm guessing, based on your post yesterday about the orsavehive limitations, that more operations than this are actually being carried out, but are not being reported on the command-line?

 

 

code below.

very simple now : delete the original hive, rename the new hive :)

{$i-}deletefile(pchar(shive));{$i-} //delete original
RenameFile(sbackup,shive); //rename backup to original
writeln('saved to '+shive+' ok');


#148 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2823 posts
  • Location:Nantes - France
  •  
    France

Posted 26 January 2018 - 01:31 PM

 

P.s. To quote Wayne and Garth "We are not worthy" :worship:

 

 

Great reference and many times use that reference with my kids (who find this completely "old school"  :lol: )



#149 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2823 posts
  • Location:Nantes - France
  •  
    France

Posted 26 January 2018 - 01:46 PM

version 1.0.1 uploaded

1.0.1
fixed : import syntax now consistent (similar to run command)
added : import will handle multi level paths
OfflineReg "c:\temp\system" " " import commands.reg
OfflineReg "c:\temp\system" " " run commands.txt

  • Atari800XL likes this

#150 Atari800XL

Atari800XL

    Frequent Member

  • Advanced user
  • 117 posts
  •  
    Netherlands

Posted 26 January 2018 - 03:27 PM

 

I am not sure under which scenario one would end up with relative paths in such a reg file?


No, you're right. No relative paths, it would just confuse things.
I was just asking because I was afraid I had missed something (could have been the case, considering the dozens of posts and versions). Please note, I'm NOT complaining, quite the opposite: as Misty already said, it's very cool and fun to watch the developments go so quickly!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users