imagex /apply
#1
Posted 09 March 2007 - 07:16 PM
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
Posted 10 March 2007 - 11:16 AM
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?
#3
Posted 10 March 2007 - 12:57 PM
The owner seems to be WinBuilder.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.
In my Q&D solution the script does:
- delete target
- start imagex /apply - which I kill
No idea how to do that in Delphi. Any help by somebody?Peter, can you try to take ownership of these undeletable folders?
Peter
#4
Posted 10 March 2007 - 02:22 PM
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!
#5
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!
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
#6
Posted 10 March 2007 - 05:51 PM
#7
Posted 10 March 2007 - 07:04 PM
#8
Posted 10 March 2007 - 07:09 PM
Thanks!
#9
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
Posted 11 March 2007 - 01:23 PM
#11
Posted 11 March 2007 - 05:59 PM
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..
#12
Posted 12 March 2007 - 10:32 AM
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 mistakeI also could not delete the folders
ps Chip.de is good magazine, but my VistaPE is not his "VistaPE", i not create it and it's different project ...
#13
Posted 12 March 2007 - 11:06 AM
They call it VistaCE ( Vista CHIP Edition)ps Chip.de is good magazine, but my VistaPE is not his "VistaPE", i not create it and it's different project ...
Peter
#14
Posted 12 March 2007 - 11:19 AM
They call it VistaCE ( Vista CHIP Edition)
Peter
Thanks
#15
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
Posted 13 March 2007 - 05:59 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users