Jump to content











Photo

Script syntax for registry?


Best Answer VeeDub , 24 January 2017 - 09:59 PM

@homes32

 

Yes I went from Win7 x86 to Win8 x64, sorry if I realised the significance of that fact I would have included.

 

I'll update the script and see how I go.

 

Cheers

 

VW

Go to the full post


  • Please log in to reply
4 replies to this topic

#1 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 19 January 2017 - 11:45 PM

Hello

 

I have recently switched from using Win7PE to Win8PE

 

I have tried to copy across some scripts that were working on the Win7PE build, however in the Win8PE build some of the registry updates don't appear to be working (although no errors are reported during the build)

 

Here is an example of the code that worked on Win7PE but doesn't seem to be working in Win8PE

[Software.AddReg]
Echo,"Loading registry hive: [software]"
RegHiveLoad,Tmp_Software,%RegSoftware%
Echo,"Writing new values on registry hive.."
RegWrite,HKLM,0x1,Tmp_Software\ShadowStor\ShadowProtectPE\Settings,"LoggingDir","B:\Logs\"
RegWrite,HKLM,0x4,Tmp_Software\ShadowStor\ShadowProtectPE\Settings,"LoggingEnabled", 0x00000001
RegHiveUnLoad,Tmp_Software

Any ideas?

 

Thanks

 

VW



#2 homes32

homes32

    Gold Member

  • .script developer
  • 1035 posts
  • Location:Minnesota
  •  
    United States

Posted 23 January 2017 - 06:03 PM

Hello

 

I have recently switched from using Win7PE to Win8PE

 

I have tried to copy across some scripts that were working on the Win7PE build, however in the Win8PE build some of the registry updates don't appear to be working (although no errors are reported during the build)

 

Here is an example of the code that worked on Win7PE but doesn't seem to be working in Win8PE

[Software.AddReg]
Echo,"Loading registry hive: [software]"
RegHiveLoad,Tmp_Software,%RegSoftware%
Echo,"Writing new values on registry hive.."
RegWrite,HKLM,0x1,Tmp_Software\ShadowStor\ShadowProtectPE\Settings,"LoggingDir","B:\Logs\"
RegWrite,HKLM,0x4,Tmp_Software\ShadowStor\ShadowProtectPE\Settings,"LoggingEnabled", 0x00000001
RegHiveUnLoad,Tmp_Software

Any ideas?

 

Thanks

 

VW

The code you posted is using native winbuilder commands so the project makes no difference in that regard.

I would check you log (or post it here if you need help) and make sure the variable %RegSoftware% is resolving to

%TargetDir%\Windows\System32\config\Software

and while your at it make sure %TargetDir% is pointing to where your build target actually resides and that the registry hives exist in that location at the time your running the code.

 

in order to see the info in the winbuilder log you may have to go into Winbuilder > Tools > and check Show Variables, Log Original Statement, Debug log, verbose


  • VeeDub likes this

#3 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 24 January 2017 - 05:51 AM

@homes32

 

Thanks for responding.

 

I have gone into WinBuilder Tools and checked the options suggested and re-run the build.

 

As far as I can see there are no errors in the script in question, other than the Script has no certification (but many of the scripts have that message).

 

I'm a newbie as far as using Winbuilder is concerned when scripts don't work out-of-the-box, so would appreciate some pointers.

 

The log for the entire build is 18MB, so I'm hoping that I don't need to upload that.

 

I have copied the output from the script in question below and I'm hoping that this provides the necessary detail to identify what the issue is.


 [Info] File [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\Shadow-505.script] Version[0]
[Warning] Script has no certification!
  
  [Run,%ScriptFile%,WinntDirectories]
 Run - Processing section: [WinntDirectories] From file: [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\Shadow-505.script]
        [Echo,"Making new directories.."]
       [Info] Making new directories..
        [DirMake,"%targetdir%\Windows\ShadowProtectPE"]
       [Success] DirMake - Created directory: [%BaseDir%\Target\Win8PESE\Windows\ShadowProtectPE]
        [DirMake,"%targetdir%\Programs\ShadowProtectPE"]
       [Success] DirMake - Created directory: [%BaseDir%\Target\Win8PESE\Programs\ShadowProtectPE]
        [DirMake,"%targetdir%\Programs\PeNetwork\x86"]
       [Success] DirMake - Created directory: [%BaseDir%\Target\Win8PESE\Programs\PeNetwork\x86]
 Run - Processed section [WinntDirectories] in file: [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\Shadow-505.script]
  [Run,%ScriptFile%,SourceDisksFolders]
 Run - Processing section: [SourceDisksFolders] From file: [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\Shadow-505.script]
        [Echo,"Copying directories.."]
       [Info] Copying directories..
        [FileCopy,"%ScriptDir%\SPExplorer\*.*","%targetdir%\Windows\ShadowProtectPE"]
       [Success] FileCopy - Copied [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\SPExplorer\*.*] to: [%BaseDir%\Target\Win8PESE\Windows\ShadowProtectPE]
        [FileCopy,"%ScriptDir%\PeNetwork\x86\*.*","%targetdir%\Programs\PeNetwork\x86"]
       [Success] FileCopy - Copied [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\PeNetwork\x86\*.*] to: [%BaseDir%\Target\Win8PESE\Programs\PeNetwork\x86]
        [FileCopy,"%ScriptDir%\ShadowProtectPE\*.*","%targetdir%\Programs\ShadowProtectPE"]
       [Success] FileCopy - Copied [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\ShadowProtectPE\*.*] to: [%BaseDir%\Target\Win8PESE\Programs\ShadowProtectPE]
 Run - Processed section [SourceDisksFolders] in file: [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\Shadow-505.script]
  [Run,%ScriptFile%,Software.AddReg]
 Run - Processing section: [Software.AddReg] From file: [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\Shadow-505.script]
        [Echo,"Loading registry hive: [software]"]
       [Info] Loading registry hive: [software]
        [RegHiveLoad,Tmp_Software,%RegSoftware%]
       [Success] RegHiveLoad - File: [%BaseDir%\Target\Win8PESE\Windows\System32\config\Software] Section [Tmp_Software]
        [Echo,"Writing new values on registry hive.."]
       [Info] Writing new values on registry hive..
        [RegWrite,HKLM,0x1,Tmp_Software\ShadowStor\ShadowProtectPE\Settings,"LoggingDir","B:\Logs\"]
       [Success] RegWrite - Type: [0x1] Section [HKLM\Tmp_Software\ShadowStor\ShadowProtectPE\Settings] Key [LoggingDir]: B:\Logs\
        [RegWrite,HKLM,0x4,Tmp_Software\ShadowStor\ShadowProtectPE\Settings,"LoggingEnabled", 0x00000001]
       [Success] RegWrite - Type: [0x4] Section [HKLM\Tmp_Software\ShadowStor\ShadowProtectPE\Settings] Key [LoggingEnabled]: 1
        [RegHiveUnLoad,Tmp_Software]
       [Success] RegHiveUnLoad - Unloaded registry hive: [Tmp_Software]
 Run - Processed section [Software.AddReg] in file: [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\Shadow-505.script]
  [Run,%ScriptFile%,ShortCuts]
 Run - Processing section: [ShortCuts] From file: [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\Shadow-505.script]
        [Add_Shortcut,Desktop]
       Run - Processing section: [AddShortcut2] From file: [%BaseDir%\Projects\Win8PESE\Build\Macro_Library.script]
             [Parameter] with parameters: [Desktop]
              [//===> Add_Shortcut,[Type],[StartMenuFolder],[(Full)FileName],[Title],[Work Folder],[Parameters],[(path)IconFile(#$cIconIndex)],[StartMode=1, 2, or 3][#$cIconIndex],[ToolTip Comment]]
              [Echo,"Create ShortCut #1 "]
             [Info] Create ShortCut Desktop
              [IniRead,%API%,IniVariablesApi,_ML_SHToRoot,%_ML_SHToRoot%]
             [Success] IniRead - [%BaseDir%\Projects\Win8PESE\Build\Macro_Library.script] Section [IniVariablesApi] Key [_ML_SHToRoot] to variable: [%_ML_SHToRoot%] with value []
              [IniRead,%API%,IniVariablesApi,_ML_SubFoldersToRoot,%_ML_SubFoldersToRoot%]
             [Success] IniRead - [%BaseDir%\Projects\Win8PESE\Build\Macro_Library.script] Section [IniVariablesApi] Key [_ML_SubFoldersToRoot] to variable: [%_ML_SubFoldersToRoot%] with value [Falsy]
              [If,#1,Equal,AutoStart,Set,#1,Autorun]
             [Ignore] IF - [desktop] is not equal to: [autostart] evaluated string: [If,#1,Equal,AutoStart,Set,#1,Autorun]
              [If,#2,Equal,QuickLaunch,Set,#1,QuickLaunch]
             [Ignore] IF - [] is not equal to: [quicklaunch] evaluated string: [If,#2,Equal,QuickLaunch,Set,#1,QuickLaunch]
              [If,#1,Equal,,Set,#1,StartMenu]
             [Ignore] IF - [desktop] is not equal to: [] evaluated string: [If,#1,Equal,,Set,#1,StartMenu]
              [If,#1,Equal,EditWith,Begin]
                   [Ignore] IF - [desktop] is not equal to: [editwith] evaluated string: [If,#1,Equal,EditWith,Begin]
                    [If,#2,Equal,,Set,#2,"Edit with"]
                   [Skipped] [If,#2,Equal,,Set,#2,"Edit with"]
              [End]
       [Ignore] [End]
        [Else,Begin]
             [Success] ELSE - executing command: [Begin]
              [// if no folder defined use the scriptfolder]
              [If,#2,Equal,,Begin]
                   [Success] IF - [] is equal to: [] evaluated string: [If,#2,Equal,,Begin]
                    [StrFormat,POS,%ScriptDir%,\App,%Pos%]
                   [Success] StrFormat - converted [POS(%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05,\App)] to variable: [%Pos%] with result: [28]
                    [StrFormat,LTRIM,%ScriptDir%,%Pos%,#2]
                   [Success] StrFormat - converted [LTRIM(%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05,#2)] to variable: [#2] with result: [Apps\Network\Shadow_v5.05]
                    [StrFormat,Replace,#2,App,"",#2]
                   [Success] StrFormat - converted [Replace(Apps\Network\Shadow_v5.05,App)] to variable: [#2] with result: [s\Network\Shadow_v5.05]
                    [StrFormat,POS,#2,\,%Pos%]
                   [Success] StrFormat - converted [POS(s\Network\Shadow_v5.05,\)] to variable: [%Pos%] with result: [2]
                    [StrFormat,LTRIM,#2,%Pos%,#2]
                   [Success] StrFormat - converted [LTRIM(s\Network\Shadow_v5.05,#2)] to variable: [#2] with result: [Network\Shadow_v5.05]
              [End]
       [Success] [End]
  [End]
 [Success] [End]
  [If,#3,Equal,,Set,#3,%PE_Programs%\%ProgramFolder%\%ProgramEXE%]
 [Success] IF - [] is equal to: [] evaluated string: [If,#3,Equal,,Set,#3,%PE_Programs%\%ProgramFolder%\%ProgramEXE%]
  [Set,#3,%PE_Programs%\%ProgramFolder%\%ProgramEXE%]
 [Success] SetVar - Sucessfuly changed the value of [#3] to: [Y:\Programs\ShadowProtectPE\ShadowProtectPE.exe]
  [If,#4,Equal,,Set,#4,%ProgramTitle%]
 [Success] IF - [] is equal to: [] evaluated string: [If,#4,Equal,,Set,#4,%ProgramTitle%]
  [Set,#4,%ProgramTitle%]
 [Success] SetVar - Sucessfuly changed the value of [#4] to: [ShadowProtect v5.05]
  [//If,#5,Equal,,StrFormat,path,#3,#5]
  [If,Not,#6,Equal,,StrFormat,Replace,#6,###$q,##$q,#6]
 [Ignore] IF - [] is equal to: [] evaluated string: [If,Not,#6,Equal,,StrFormat,Replace,#6,#",#$q,#6]
  [If,Not,#7,Equal,,Begin]
 [Ignore] IF - [] is equal to: [] evaluated string: [If,Not,#7,Equal,,Begin]
  [StrFormat,path,#7,%SHC_Icon_Path%]
 [Skipped] [StrFormat,path,#7,%SHC_Icon_Path%]
  [StrFormat,filename,#7,%SHC_Icon_FileName%]
 [Skipped] [StrFormat,filename,#7,%SHC_Icon_FileName%]
  [If,%SHC_Icon_Path%,Equal,,StrFormat,path,#3,%SHC_Icon_Path%]
 [Skipped] [If,%SHC_Icon_Path%,Equal,,StrFormat,path,#3,%SHC_Icon_Path%]
  [Set,#7,%SHC_Icon_Path%%SHC_Icon_FileName%]
 [Skipped] [Set,#7,%SHC_Icon_Path%%SHC_Icon_FileName%]
  [End]
 [Ignore] [End]
  [If,#1,Equal,StartMenu,If,%_ML_SubFoldersToRoot%,Equal,Truely,StrFormat,Filename,#2,#2]
 [Ignore] IF - [desktop] is not equal to: [startmenu] evaluated string: [If,#1,Equal,StartMenu,If,%_ML_SubFoldersToRoot%,Equal,Truely,StrFormat,Filename,#2,#2]
  [If,#1,Equal,StartMenu,Begin]
 [Ignore] IF - [desktop] is not equal to: [startmenu] evaluated string: [If,#1,Equal,StartMenu,Begin]
  [If,Not,%_ML_SHToRoot%,Equal,,Begin]
 [Skipped] [If,Not,%_ML_SHToRoot%,Equal,,Begin]
  [StrFormat,Left,#2,3,%_ML_parTwoLeftThreeResult%]
 [Skipped] [StrFormat,Left,#2,3,%_ML_parTwoLeftThreeResult%]
  [If,%_ML_parTwoLeftThreeResult%,Equal,..\,StrFormat,LTrim,#2,3,#2]
 [Skipped] [If,%_ML_parTwoLeftThreeResult%,Equal,..\,StrFormat,LTrim,#2,3,#2]
  [StrFormat,Left,#2,2,%_ML_parTwoLeftTwoResult%]
 [Skipped] [StrFormat,Left,#2,2,%_ML_parTwoLeftTwoResult%]
  [If,%_ML_parTwoLeftTwoResult%,Equal,..,StrFormat,LTrim,#2,2,#2]
 [Skipped] [If,%_ML_parTwoLeftTwoResult%,Equal,..,StrFormat,LTrim,#2,2,#2]
  [If,%_ML_parTwoLeftTwoResult%,Equal,.\,StrFormat,LTrim,#2,2,#2]
 [Skipped] [If,%_ML_parTwoLeftTwoResult%,Equal,.\,StrFormat,LTrim,#2,2,#2]
  [StrFormat,Left,#2,1,%_ML_parTwoLeftOneResult%]
 [Skipped] [StrFormat,Left,#2,1,%_ML_parTwoLeftOneResult%]
  [If,%_ML_parTwoLeftOneResult%,Equal,.,StrFormat,LTrim,#2,1,#2]
 [Skipped] [If,%_ML_parTwoLeftOneResult%,Equal,.,StrFormat,LTrim,#2,1,#2]
  [Set,#2,..\#2]
 [Skipped] [Set,#2,..\#2]
  [End]
 [Ignore] [End]
  [End]
 [Ignore] [End]
  [//this makes all with no folder --> explorer shell to programs -- bsexplorer to root If,Not,%_ML_SHToRoot%,Equal,,If,#1,Equal,StartMenu,Set,#1,""]
  [If,#1,Equal,StartMenu,Set,#1,#2]
 [Ignore] IF - [desktop] is not equal to: [startmenu] evaluated string: [If,#1,Equal,StartMenu,Set,#1,#2]
  [If,#1,Equal,EditWith,Run,%API%,RegAdd_boot_%_ML_RegAddBootMethod%,HKLM,0x2,Software\Classes\*\shell\#2#$s#4\command,,"#3 #$q#$p1#$q"]
 [Ignore] IF - [desktop] is not equal to: [editwith] evaluated string: [If,#1,Equal,EditWith,Run,%API%,RegAdd_boot_%_ML_RegAddBootMethod%,HKLM,0x2,Software\Classes\*\shell\#2 #4\command,,"#3 "%1""]
  [Else,Begin]
 [Success] ELSE - executing command: [Begin]
  [If,#1,Equal,Autorun,Run,%API%,Add_Auto_Run%API_TYPE%,#4,#3,#6,2]
 [Ignore] IF - [desktop] is not equal to: [autorun] evaluated string: [If,#1,Equal,Autorun,Run,%API%,Add_Auto_Run%API_TYPE%,#4,#3,#6,2]
  [Else,IniWriteTextLine,%PE_CFG%,shortcut,"#1|#4|#3|#7|#6"]
 [Success] ELSE - executing command: [IniWriteTextLine,%PE_CFG%,shortcut,#1|#4|#3|#7|#6]
  [IniWriteTextLine,%PE_CFG%,shortcut,#1|#4|#3|#7|#6]
 [Success] IniWriteTextLine - Wrote INI text line in [%BaseDir%\Target\Win8PESE\Windows\System32\Win8PE.cfg] Section [shortcut] line [Desktop|ShadowProtect v5.05|Y:\Programs\ShadowProtectPE\ShadowProtectPE.exe||]
  [End]
 [Success] [End]
 Run - Processed section [AddShortcut2] in file: [%BaseDir%\Projects\Win8PESE\Build\Macro_Library.script]
  [Add_Shortcut,StartMenu]
 Run - Processing section: [AddShortcut2] From file: [%BaseDir%\Projects\Win8PESE\Build\Macro_Library.script]
 [Parameter] with parameters: [StartMenu]
  [//===> Add_Shortcut,[Type],[StartMenuFolder],[(Full)FileName],[Title],[Work Folder],[Parameters],[(path)IconFile(#$cIconIndex)],[StartMode=1, 2, or 3][#$cIconIndex],[ToolTip Comment]]
  [Echo,"Create ShortCut #1 "]
 [Info] Create ShortCut StartMenu
  [IniRead,%API%,IniVariablesApi,_ML_SHToRoot,%_ML_SHToRoot%]
 [Success] IniRead - [%BaseDir%\Projects\Win8PESE\Build\Macro_Library.script] Section [IniVariablesApi] Key [_ML_SHToRoot] to variable: [%_ML_SHToRoot%] with value []
  [IniRead,%API%,IniVariablesApi,_ML_SubFoldersToRoot,%_ML_SubFoldersToRoot%]
 [Success] IniRead - [%BaseDir%\Projects\Win8PESE\Build\Macro_Library.script] Section [IniVariablesApi] Key [_ML_SubFoldersToRoot] to variable: [%_ML_SubFoldersToRoot%] with value [Falsy]
  [If,#1,Equal,AutoStart,Set,#1,Autorun]
 [Ignore] IF - [startmenu] is not equal to: [autostart] evaluated string: [If,#1,Equal,AutoStart,Set,#1,Autorun]
  [If,#2,Equal,QuickLaunch,Set,#1,QuickLaunch]
 [Ignore] IF - [] is not equal to: [quicklaunch] evaluated string: [If,#2,Equal,QuickLaunch,Set,#1,QuickLaunch]
  [If,#1,Equal,,Set,#1,StartMenu]
 [Ignore] IF - [startmenu] is not equal to: [] evaluated string: [If,#1,Equal,,Set,#1,StartMenu]
  [If,#1,Equal,EditWith,Begin]
 [Ignore] IF - [startmenu] is not equal to: [editwith] evaluated string: [If,#1,Equal,EditWith,Begin]
  [If,#2,Equal,,Set,#2,"Edit with"]
 [Skipped] [If,#2,Equal,,Set,#2,"Edit with"]
  [End]
 [Ignore] [End]
  [Else,Begin]
 [Success] ELSE - executing command: [Begin]
  [// if no folder defined use the scriptfolder]
  [If,#2,Equal,,Begin]
 [Success] IF - [] is equal to: [] evaluated string: [If,#2,Equal,,Begin]
  [StrFormat,POS,%ScriptDir%,\App,%Pos%]
 [Success] StrFormat - converted [POS(%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05,\App)] to variable: [%Pos%] with result: [28]
  [StrFormat,LTRIM,%ScriptDir%,%Pos%,#2]
 [Success] StrFormat - converted [LTRIM(%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05,#2)] to variable: [#2] with result: [Apps\Network\Shadow_v5.05]
  [StrFormat,Replace,#2,App,"",#2]
 [Success] StrFormat - converted [Replace(Apps\Network\Shadow_v5.05,App)] to variable: [#2] with result: [s\Network\Shadow_v5.05]
  [StrFormat,POS,#2,\,%Pos%]
 [Success] StrFormat - converted [POS(s\Network\Shadow_v5.05,\)] to variable: [%Pos%] with result: [2]
  [StrFormat,LTRIM,#2,%Pos%,#2]
 [Success] StrFormat - converted [LTRIM(s\Network\Shadow_v5.05,#2)] to variable: [#2] with result: [Network\Shadow_v5.05]
  [End]
 [Success] [End]
  [End]
 [Success] [End]
  [If,#3,Equal,,Set,#3,%PE_Programs%\%ProgramFolder%\%ProgramEXE%]
 [Success] IF - [] is equal to: [] evaluated string: [If,#3,Equal,,Set,#3,%PE_Programs%\%ProgramFolder%\%ProgramEXE%]
  [Set,#3,%PE_Programs%\%ProgramFolder%\%ProgramEXE%]
 [Success] SetVar - Sucessfuly changed the value of [#3] to: [Y:\Programs\ShadowProtectPE\ShadowProtectPE.exe]
  [If,#4,Equal,,Set,#4,%ProgramTitle%]
 [Success] IF - [] is equal to: [] evaluated string: [If,#4,Equal,,Set,#4,%ProgramTitle%]
  [Set,#4,%ProgramTitle%]
 [Success] SetVar - Sucessfuly changed the value of [#4] to: [ShadowProtect v5.05]
  [//If,#5,Equal,,StrFormat,path,#3,#5]
  [If,Not,#6,Equal,,StrFormat,Replace,#6,###$q,##$q,#6]
 [Ignore] IF - [] is equal to: [] evaluated string: [If,Not,#6,Equal,,StrFormat,Replace,#6,#",#$q,#6]
  [If,Not,#7,Equal,,Begin]
 [Ignore] IF - [] is equal to: [] evaluated string: [If,Not,#7,Equal,,Begin]
  [StrFormat,path,#7,%SHC_Icon_Path%]
 [Skipped] [StrFormat,path,#7,%SHC_Icon_Path%]
  [StrFormat,filename,#7,%SHC_Icon_FileName%]
 [Skipped] [StrFormat,filename,#7,%SHC_Icon_FileName%]
  [If,%SHC_Icon_Path%,Equal,,StrFormat,path,#3,%SHC_Icon_Path%]
 [Skipped] [If,%SHC_Icon_Path%,Equal,,StrFormat,path,#3,%SHC_Icon_Path%]
  [Set,#7,%SHC_Icon_Path%%SHC_Icon_FileName%]
 [Skipped] [Set,#7,%SHC_Icon_Path%%SHC_Icon_FileName%]
  [End]
 [Ignore] [End]
  [If,#1,Equal,StartMenu,If,%_ML_SubFoldersToRoot%,Equal,Truely,StrFormat,Filename,#2,#2]
 [Success] IF - [startmenu] is equal to: [startmenu] evaluated string: [If,#1,Equal,StartMenu,If,%_ML_SubFoldersToRoot%,Equal,Truely,StrFormat,Filename,#2,#2]
  [If,%_ML_SubFoldersToRoot%,Equal,Truely,StrFormat,Filename,#2,#2]
 [Ignore] IF - [falsy] is not equal to: [truely] evaluated string: [If,%_ML_SubFoldersToRoot%,Equal,Truely,StrFormat,Filename,#2,#2]
  [If,#1,Equal,StartMenu,Begin]
 [Success] IF - [startmenu] is equal to: [startmenu] evaluated string: [If,#1,Equal,StartMenu,Begin]
  [If,Not,%_ML_SHToRoot%,Equal,,Begin]
 [Ignore] IF - [] is equal to: [] evaluated string: [If,Not,%_ML_SHToRoot%,Equal,,Begin]
  [StrFormat,Left,#2,3,%_ML_parTwoLeftThreeResult%]
 [Skipped] [StrFormat,Left,#2,3,%_ML_parTwoLeftThreeResult%]
  [If,%_ML_parTwoLeftThreeResult%,Equal,..\,StrFormat,LTrim,#2,3,#2]
 [Skipped] [If,%_ML_parTwoLeftThreeResult%,Equal,..\,StrFormat,LTrim,#2,3,#2]
  [StrFormat,Left,#2,2,%_ML_parTwoLeftTwoResult%]
 [Skipped] [StrFormat,Left,#2,2,%_ML_parTwoLeftTwoResult%]
  [If,%_ML_parTwoLeftTwoResult%,Equal,..,StrFormat,LTrim,#2,2,#2]
 [Skipped] [If,%_ML_parTwoLeftTwoResult%,Equal,..,StrFormat,LTrim,#2,2,#2]
  [If,%_ML_parTwoLeftTwoResult%,Equal,.\,StrFormat,LTrim,#2,2,#2]
 [Skipped] [If,%_ML_parTwoLeftTwoResult%,Equal,.\,StrFormat,LTrim,#2,2,#2]
  [StrFormat,Left,#2,1,%_ML_parTwoLeftOneResult%]
 [Skipped] [StrFormat,Left,#2,1,%_ML_parTwoLeftOneResult%]
  [If,%_ML_parTwoLeftOneResult%,Equal,.,StrFormat,LTrim,#2,1,#2]
 [Skipped] [If,%_ML_parTwoLeftOneResult%,Equal,.,StrFormat,LTrim,#2,1,#2]
  [Set,#2,..\#2]
 [Skipped] [Set,#2,..\#2]
  [End]
 [Ignore] [End]
  [End]
 [Success] [End]
  [//this makes all with no folder --> explorer shell to programs -- bsexplorer to root If,Not,%_ML_SHToRoot%,Equal,,If,#1,Equal,StartMenu,Set,#1,""]
  [If,#1,Equal,StartMenu,Set,#1,#2]
 [Success] IF - [startmenu] is equal to: [startmenu] evaluated string: [If,#1,Equal,StartMenu,Set,#1,#2]
  [Set,#1,#2]
 [Success] SetVar - Sucessfuly changed the value of [#1] to: [Network\Shadow_v5.05]
  [If,#1,Equal,EditWith,Run,%API%,RegAdd_boot_%_ML_RegAddBootMethod%,HKLM,0x2,Software\Classes\*\shell\#2#$s#4\command,,"#3 #$q#$p1#$q"]
 [Ignore] IF - [network\shadow_v5.05] is not equal to: [editwith] evaluated string: [If,#1,Equal,EditWith,Run,%API%,RegAdd_boot_%_ML_RegAddBootMethod%,HKLM,0x2,Software\Classes\*\shell\#2 #4\command,,"#3 "%1""]
  [Else,Begin]
 [Success] ELSE - executing command: [Begin]
  [If,#1,Equal,Autorun,Run,%API%,Add_Auto_Run%API_TYPE%,#4,#3,#6,2]
 [Ignore] IF - [network\shadow_v5.05] is not equal to: [autorun] evaluated string: [If,#1,Equal,Autorun,Run,%API%,Add_Auto_Run%API_TYPE%,#4,#3,#6,2]
  [Else,IniWriteTextLine,%PE_CFG%,shortcut,"#1|#4|#3|#7|#6"]
 [Success] ELSE - executing command: [IniWriteTextLine,%PE_CFG%,shortcut,#1|#4|#3|#7|#6]
  [IniWriteTextLine,%PE_CFG%,shortcut,#1|#4|#3|#7|#6]
 [Success] IniWriteTextLine - Wrote INI text line in [%BaseDir%\Target\Win8PESE\Windows\System32\Win8PE.cfg] Section [shortcut] line [Network\Shadow_v5.05|ShadowProtect v5.05|Y:\Programs\ShadowProtectPE\ShadowProtectPE.exe||]
  [End]
 [Success] [End]
 Run - Processed section [AddShortcut2] in file: [%BaseDir%\Projects\Win8PESE\Build\Macro_Library.script]
 Run - Processed section [ShortCuts] in file: [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\Shadow-505.script]
  [Run,%ScriptFile%,Append]
 Run - Processing section: [Append] From file: [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\Shadow-505.script]
 Run - Processed section [Append] in file: [%BaseDir%\Projects\Win8PESE\Apps\Network\Shadow_v5.05\Shadow-505.script]
 [Clock] Script time: 3 seconds and 182 milliseconds

 [Done] Finished processing script: Network: ShadowProtect v5.05


#4 homes32

homes32

    Gold Member

  • .script developer
  • 1035 posts
  • Location:Minnesota
  •  
    United States

Posted 24 January 2017 - 03:40 PM

unfortunately, the log doesn't seem very helpful in this case as all things point to a successful build.

 

A couple more questions:

  • Have you verified using a registry editor in PE that the registry entries didn't get written or are you just going by the program not writing the logs where the reg entry points?
  • When you used this plugin in Win7PE and it worked was your Win7 build media x86 (32bit) or x64 (64bit)
  • Is your Win8 build media x86 (32bit) or x64 (64bit)

If you were previously using x86 Win7 and now you are using x64 I can see why you might suddenly be seeing this issue switching projects to a x64 build. IF the registry entries are being created but the program isn't using them. in that case you would need to change the script code to:

[Software.AddReg]
Echo,"Loading registry hive: [software]"
RegHiveLoad,Tmp_Software,%RegSoftware%
Echo,"Writing new values on registry hive.."
RegWrite,HKLM,0x1,Tmp_Software\Wow6432Node\ShadowStor\ShadowProtectPE\Settings,"LoggingDir","B:\Logs\"
RegWrite,HKLM,0x4,Tmp_Software\Wow6432Node\ShadowStor\ShadowProtectPE\Settings,"LoggingEnabled", 0x00000001
RegHiveUnLoad,Tmp_Software

in order for a 32bit program to read the registry settings on a x64 PE.


  • VeeDub likes this

#5 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 24 January 2017 - 09:59 PM   Best Answer

@homes32

 

Yes I went from Win7 x86 to Win8 x64, sorry if I realised the significance of that fact I would have included.

 

I'll update the script and see how I go.

 

Cheers

 

VW






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users