Jump to content











Photo
- - - - -

imagex /apply


  • Please log in to reply
15 replies to this topic

#1 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 09 March 2007 - 07:16 PM

The German Computer Magazin Chip published a Vista PE solution based on WinBuilder.
Many readers complained that they are not able to delete the working directories

(I tried: Even starting from a different HDD, I also could not delete the folders)

I found a quick and dirty solution:

Start the script with the imagex /applay again and kill the cmd window which appears.
After that the folders are deletable.

The (German) forum topic can be found here

Peter

#2 Brito

Brito

    Platinum Member

  • .script developer
  • 10565 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 10 March 2007 - 11:16 AM

Very ingenious solution, congratulations! :P

But why wouldn't it be possible to delete under NTFS?

The quick idea that comes to mind is that imagex sets the ownerships of the work folders to the system account as expected under PE environments (not even sure if this is possible) to ensure that no other process interfers with it.

At least this would explain the reason why they keep being unremovable when plugged on another OS.

Peter, can you try to take ownership of these undeletable folders? :P

#3 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 10 March 2007 - 12:57 PM

The quick idea that comes to mind is that imagex sets the ownerships of the work folders to the system account as expected under PE environments (not even sure if this is possible) to ensure that no other process interfers with it.

At least this would explain the reason why they keep being unremovable when plugged on another OS.

The owner seems to be WinBuilder.
In my Q&D solution the script does:
  • delete target
  • start imagex /apply - which I kill
So deleting the target is no problem for WinBuilder

Peter, can you try to take ownership of these undeletable folders? :P

No idea how to do that in Delphi. Any help by somebody?

Peter

#4 Brito

Brito

    Platinum Member

  • .script developer
  • 10565 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 10 March 2007 - 02:22 PM

Here's a script snippet from microsoft support with detailed informations:
http://www.microsoft...06/hey0111.mspx

Also a good console app for our scripts already done here:
http://www.msfn.org/...showtopic=93629
http://www.msfn.org/...p...st&p=631554



Under delphi you can also start imagex and then kill the process, simulating the user press on the close window button:

Var 

   exInfo: TShellExecuteInfo;

   exitcode: DWORD;

 Begin

   FillChar( exInfo, Sizeof(exInfo), 0 );

   With exInfo Do Begin

	 cbSize:= Sizeof( exInfo ); // required!

	 fMask := SEE_MASK_NOCLOSEPROCESS or SEE_MASK_FLAG_DDEWAIT;

	 Wnd   := Handle;  // forms handle

	 lpVerb:= 'open';

	 lpFile:= Pchar( programfilenamewithpath );

	 nShow := SW_SHOWNORMAL

   End;

   If ShellExecuteEx( @exInfo ) Then Begin

	  While GetExitCodeProcess( exinfo.hProcess, exitcode )

			and (exitcode = STILL_ACTIVE) 

	  Do

		  begin

			 Sleep( 1500 ); // pause program for 1,5 seconds

			  // application.ProcessMessages;

			   //if scriptHalt then

			 terminateProcess(exInfo.hProcess, WM_QUIT); // send the message for the launched app to close itself

			 

			 end;





	  CloseHandle( exinfo.hProcess );  

   End  

   Else

	 ShowMessage(SysErrorMessage( GetLastError ));

Good luck! :P

#5 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 10 March 2007 - 03:00 PM

Here's a script snippet from microsoft support with detailed informations:
http://www.microsoft...06/hey0111.mspx

Also a good console app for our scripts already done here:
http://www.msfn.org/...showtopic=93629
http://www.msfn.org/...p...st&p=631554



Under delphi you can also start imagex and then kill the process, simulating the user press on the close window button:

Var 

	exInfo: TShellExecuteInfo;

	exitcode: DWORD;

  Begin

	FillChar( exInfo, Sizeof(exInfo), 0 );

	With exInfo Do Begin

	  cbSize:= Sizeof( exInfo ); // required!

	  fMask := SEE_MASK_NOCLOSEPROCESS or SEE_MASK_FLAG_DDEWAIT;

	  Wnd   := Handle;  // forms handle

	  lpVerb:= 'open';

	  lpFile:= Pchar( programfilenamewithpath );

	  nShow := SW_SHOWNORMAL

	End;

	If ShellExecuteEx( @exInfo ) Then Begin

	   While GetExitCodeProcess( exinfo.hProcess, exitcode )

			 and (exitcode = STILL_ACTIVE) 

	   Do

		   begin

			  Sleep( 1500 ); // pause program for 1,5 seconds

			   // application.ProcessMessages;

				//if scriptHalt then

			  terminateProcess(exInfo.hProcess, WM_QUIT); // send the message for the launched app to close itself

			  

			  end;

 

 

	   CloseHandle( exinfo.hProcess );  

	End  

	Else

	  ShowMessage(SysErrorMessage( GetLastError ));

Good luck! :P


It is much easier:

In CHIP I posted a changed mount script with an optional Halt command after deleting the target.
(That's like my manually killing imagex).

Works fine.

Maybe you find a online Translation for my German post
But you can at least understand the included script.

Peter :P

#6 Brito

Brito

    Platinum Member

  • .script developer
  • 10565 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 10 March 2007 - 05:51 PM

Glad to see your solution working!! :P

#7 paraglider

paraglider

    Gold Member

  • .script developer
  • 1739 posts
  • Location:NC,USA
  •  
    United States

Posted 10 March 2007 - 07:04 PM

Does not happen for me when I build vistape. I can delete the work directories without any problem. I am however building on Vista.

#8 Brito

Brito

    Platinum Member

  • .script developer
  • 10565 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 10 March 2007 - 07:09 PM

Just as curiosity, have you had any issues with UAC? :P

Thanks!

#9 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 10 March 2007 - 07:19 PM

Does not happen for me when I build vistape. I can delete the work directories without any problem. I am however building on Vista.


I looked into our VistaPE and did not see any imagex /apply. So currently in VistPE the issue should not occur.

Peter

#10 paraglider

paraglider

    Gold Member

  • .script developer
  • 1739 posts
  • Location:NC,USA
  •  
    United States

Posted 11 March 2007 - 01:23 PM

Yes. I hate UAC. I disabled it. Both Bartpe and winbuilder XP source builds don't generate correctly on Vista so I switched to doing all my XP source builds in an XP VM.

#11 Brito

Brito

    Platinum Member

  • .script developer
  • 10565 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 11 March 2007 - 05:59 PM

There's a mac promotional clip kidding about UAC, it do feels a bit like this:
http://movies.apple....ity_480x376.mov

UAC is good for avoiding spyware to write their hidden entries on the registry, but sooner or later they also find their way inside - especially since setup files are executed with administrative rights wich pretty much leaves intrusive software do whatever they want with host machine as before, also worth mentioning that programs that are started as services are not limited as well.

If there is a need to limit hazards on the sensitive area of the OS, then why not creating sandbox spaces where these restrictions wouldn't be needed and were only applied to a personal user space that could be restaured from time to time? Or perhaps they are trying to evolve in this direction and this is a step to ensure that future applications won't be designed to use administrative actions.

Tough times.. :P

#12 NightMan

NightMan

    Frequent Member

  • .script developer
  • 433 posts
  • Location:Russian, Moscow

Posted 12 March 2007 - 10:32 AM

psc

I also could not delete the folders

:P i know about this problem, WIM files can save NTFS permission and when you use "imagex /apply", you decompress all files with all permission and you not have access to some files... one time i try decompress all files from install.wim, it's was big mistake :P

ps Chip.de is good magazine, but my VistaPE is not his "VistaPE", i not create it and it's different project ...

#13 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 12 March 2007 - 11:06 AM

ps Chip.de is good magazine, but my VistaPE is not his "VistaPE", i not create it and it's different project ...

They call it VistaCE ( Vista CHIP Edition)

Peter :P

#14 NightMan

NightMan

    Frequent Member

  • .script developer
  • 433 posts
  • Location:Russian, Moscow

Posted 12 March 2007 - 11:19 AM

They call it VistaCE ( Vista CHIP Edition)

Peter :P


Thanks :P

#15 TheHive

TheHive

    Platinum Member

  • .script developer
  • 4173 posts

Posted 13 March 2007 - 04:16 PM

There's a mac promotional clip kidding about UAC, it do feels a bit like this:
http://movies.apple....ity_480x376.mov


Yeah! first time I saw that commercial. I was cracking up.

#16 Brito

Brito

    Platinum Member

  • .script developer
  • 10565 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 13 March 2007 - 05:59 PM

It's true and truly annoying.. :cheers:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users