Update the section with the following lines (shown in green):
Label:Dev_Restore_Image_Name
; Launch a Form to enter image name
Form:Start,"Form_RestoreImageName","Enter image name","_OkCancel^_Ok",Blue
Form:Item,"Item1",Label,"Image path"
Form:Item,"Item2",EditBox,"%Restore_Image_Path%",ReadOnly
Form:Item,"Item3",Label,"Enter image name"
If:Var,Lookup_Image_Type,EQ,"Other"
Form:Item,"Item4",Browse_File,"%WimPath%","Specify a WIM file","%Images_Path%","wim","open"
Else:
Form:Item,"Item4",EditBox,"%Image_Name%"
End:
Form:Display,"Form_RestoreImageName"
If:Var,_Form,EQ,"_Cancel"
Menu:Return
End:
Set:Image_Name,"%_Form_RestoreImageName_Item4%"
Set:ExtensionCheck,Right("%Image_Name%",4)
If:var,ExtensionCheck,NE,".wim"
Set:Image_Name,"%Image_Name%.wim"
End:
File:Run,"net use "%Images_Path%" /user:%Images_Share_Username% %Images_Share_Password%",silent
If:Var,Lookup_Image_Type,EQ,"OS"
Wim:Apply,"%Images_Path%\%Restore_Image_Path%\%Image_Name%"
If:EFI,Exist
; Copy boot files from the Windows partition to the System partition
File:Run,"bcdboot %Project_Partition%\Windows"
End:
File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Base_Image",Base_Image
If:Var,Image_Name,EQ,"%Base_Image%.wim"
; Image name matches project 'base image' name therefore we are restoring a sysprepped base image.
else:
; non sysprepped image restored so we need to update the bcd store with the correct paths.
If:Var,Partition_Count,EQ,"1"
File:Run,"cmd /c bcdedit /set {default} device partition=C: >> %_ZimDir%/zim.log"
File:Run,"cmd /c bcdedit /set {default} osdevice partition=C: >> %_ZimDir%/zim.log"
File:Run,"cmd /c bcdedit /set {bootmgr} device partition=C: >> %_ZimDir%/zim.log"
Else:
File:Run,"cmd /c bcdedit /set {default} device partition=D: >> %_ZimDir%/zim.log"
File:Run,"cmd /c bcdedit /set {default} osdevice partition=D: >> %_ZimDir%/zim.log"
File:Run,"cmd /c bcdedit /set {bootmgr} device partition=C: >> %_ZimDir%/zim.log"
End:
End:
ElseIf:Var,Lookup_Image_Type,EQ,"Other"
Wim:Apply,"%Image_Name%"
Else:
Wim:Apply,"%Images_Path%\%Restore_Image_Path%\%Image_Name%","1","%Project_Partition%"
End:
File:Run,"net use "%Images_Path%" /delete /yes",silent
Menu:Return