MSFN Forum: Add Right click .wim Windows 7 - MSFN Forum

Jump to content


  • 5 Pages +
  • « First
  • 2
  • 3
  • 4
  • 5
  • You cannot start a new topic
  • You cannot reply to this topic

Add Right click .wim Windows 7 Working with Windows 8 and UAC ON or OFF

#61 User is offline   MrJinje 

  • Tool™ Developer
  • Group: Developers
  • Posts: 942
  • Joined: 14-October 09
  • OS:none specified
  • Country: Country Flag

Posted 19 September 2012 - 01:03 PM

View Posturie, on 19 September 2012 - 12:34 PM, said:

Van, Mount R/W = Enter Image Index # ids fine if they actually know what the images are we had this long while back and had to post image indexes of x86 and x64.
I know they should use wim.info but not everyone will :(


If the problem exists between the keyboard and chair, then fix is simple. We need to use a more advanced snip to run the get-wiminfo first and pipe it's result to pre-populate a drop down list. Could probably capture the image description as well as the index #.

This post has been edited by MrJinje: 19 September 2012 - 01:07 PM



#62 User is offline   GrofLuigi 

  • GroupPolicy Tattoo Artist
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,275
  • Joined: 21-April 05
  • OS:none specified
  • Country: Country Flag

Posted 19 September 2012 - 06:45 PM

View PostMrJinje, on 19 September 2012 - 06:46 AM, said:

I've found that when I elevate on Windows 8, I lose access to my shared map drive in Virtual Box. I can confirm this by running "as administrator" explorer.exe from the command line that the mapped drive does not exist under my full admin token (but does when I use Secpol.msc to auto-elevate requests without prompt), anybody else notice that ?

It reminds me of this...

GL

#63 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,748
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 20 September 2012 - 02:02 AM

View Posturie, on 19 September 2012 - 12:34 PM, said:

I know they should use wim.info but not everyone will :(

I like the heck out of that Input box method cause it cleans it up

Perhaps this is simple fix cause trying to do a .wim info and stuffing that to an inputbox might be a nightmare.
I tend to forget that some trying to do this does no reading. They want fast and quick without any effort. Those of us been doing this awhile know and read a little before asking ?
I do show a pic of .wim info in 1st post

I modified the Inputbox
Enter Image Index # from .Wim Info
You can click Cancel in those boxes and then close cmd window no problem

Attached File  Index.PNG (16.45K)
Number of downloads: 1

This post has been edited by maxXPsoft: 20 September 2012 - 02:13 AM


#64 User is offline   urie 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 517
  • Joined: 30-July 03

Posted 20 September 2012 - 06:36 AM

On second thoughts input box is better if some one was using an AIO there would be a lot more indexes :)

#65 User is offline   MrJinje 

  • Tool™ Developer
  • Group: Developers
  • Posts: 942
  • Joined: 14-October 09
  • OS:none specified
  • Country: Country Flag

Posted 23 September 2012 - 06:47 AM

Made a re-write (closes properly on input box cancel, avoids second message box/switch pop up, and cmd /c kills the cmd window afterwords), overall it seems much cleaner. When an input box is canceled it returns a null value, now that I know, this snip checks for that and exits. Else it runs the command without having to go into the second pop-up window. If the CMD /C kills the command window before it's done mounting try CMD /K (that might have been why I used it in the first place for DISM)

This is what's going into my next SLMGR, chop it up and edit your DISM bits in.

@="elevate cmd /c start /b powershell -command \"clear-host;[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic');$KEY = [Microsoft.VisualBasic.Interaction]::InputBox('Enter Product Key', 'Enter a Product Key', 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX');If ($KEY -eq '') {exit} Else{wscript.exe C:\\Windows\\System32\\slmgr.vbs -ipk $KEY}\""





Got bored, copy pasta'd your snip into this.

@="cmd /k start /b powershell -command \"clear-host;[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic');$INDEX = [Microsoft.VisualBasic.Interaction]::InputBox('Enter Image Index #', 'Which image to mount', '1');If ($INDEX -eq '') {exit} Else{Dism /mount-wim /wimfile:\"%1\" /index:$INDEX /mountdir:C:\\zMountDir}\""





Still working on a get-wiminfo integration, here is sneak peak. Not liking the word wrap, gonna spend a little more time on it.

Posted Image

This post has been edited by MrJinje: 27 September 2012 - 03:16 AM


#66 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,748
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 23 September 2012 - 10:30 PM

View PostMrJinje, on 23 September 2012 - 06:47 AM, said:

Still working on a get-wiminfo integration, here is sneak peak. Not liking the word wrap, gonna spend a little more time on it.

Try setting the message box Title longer. I have done that in normal VB to stretch the box.
looking good. I have been unable to do the wim info with UAC ON so am anxious to see what you done there. I am experimenting with the powershell big time.

#67 User is offline   MrJinje 

  • Tool™ Developer
  • Group: Developers
  • Posts: 942
  • Joined: 14-October 09
  • OS:none specified
  • Country: Country Flag

Posted 25 September 2012 - 08:25 AM

View PostmaxXPsoft, on 23 September 2012 - 10:30 PM, said:

Try setting the message box Title longer. I have done that in normal VB to stretch the box.
looking good. I have been unable to do the wim info with UAC ON so am anxious to see what you done there. I am experimenting with the powershell big time.

Thanks will try that. Found a possible option for leaving UAC on and requesting elevation inline. If you check the last two lines, you'll also see a way to add a cmd.exe style 'pause' to Powershell. Most of it is comments, when I get time I will re-write it..

http://blogs.msdn.co...ell-script.aspx

UPDATE, here is rewrite, removed comments, deleted fluff, replaced double quotes, added variables to reduce length, added semi-colons everywhere.

$WID=[System.Security.Principal.WindowsIdentity]::GetCurrent();$WIP=new-object System.Security.Principal.WindowsPrincipal($WID);$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator;if ($WIP.IsInRole($adminRole)){}else{$newProcess = new-object System.Diagnostics.ProcessStartInfo 'PowerShell';$newProcess.Arguments = $myInvocation.MyCommand.Definition;$newProcess.Verb = 'runas';[System.Diagnostics.Process]::Start($newProcess);Write-Host 'Prompting for Elevation';exit;}Write-Host 'ElevatedCodeRunsHere';Write-Host -NoNewLine 'Press any key to continue...';$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');




and here's a snip regarding execution policy (for those who scrolled all the way to the end)

http://www.nivot.org...-in-Script.aspx

Quote

If you want to run ps1 scripts in your own application, simply host your own Runspace and use the base authorization manager which pays no heed to system execution policy, even if it’s controlled by group policy and immune to powershell –bypass and set-executiopolicy:

Bypassing in Script

Now this is a little more hackish because it involves manipulating powershell.exe internals at runtime. This is a useful one-liner (if you can memorise it) when you find yourself in one of those clients who has GPO controlled execution policy. It’s pushing it for a one-liner, I know, but hey:


function Disable-ExecutionPolicy {
    ($ctx = $executioncontext.gettype().getfield(
        "_context","nonpublic,instance").getvalue(
            $executioncontext)).gettype().getfield(
                "_authorizationManager","nonpublic,instance").setvalue(
        $ctx, (new-object System.Management.Automation.AuthorizationManager
                  "Microsoft.PowerShell"))
}

This post has been edited by MrJinje: 27 September 2012 - 03:16 AM


#68 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,748
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 26 September 2012 - 10:00 AM

Interesting but it looked ugly when I done a 'dism /Get-WimInfo /WimFile:\"%1\"

I don't have a problem with UAC on in Win 8 except the Dism exe does not pause. It does execute the commands but won't pause.
Dism window flashes and then it pauses
I have this so far
@="cmd /c start /b powershell -command Dism /Get-WimInfo /WimFile:\"%1\";Write-Host -NoNewLine 'Press any key to continue...';$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');"


Right now I don't have much time till possibly this weekend if I'm off to look at this.

This post has been edited by maxXPsoft: 26 September 2012 - 10:17 AM


#69 User is offline   MrJinje 

  • Tool™ Developer
  • Group: Developers
  • Posts: 942
  • Joined: 14-October 09
  • OS:none specified
  • Country: Country Flag

Posted 26 September 2012 - 10:22 PM

My bad, forgot to post the get-wiminfo cleanup routine. So far I've got it working from a batch file. Basically I hard-coded a 15 member array, parse the first 15 images of get-wiminfo results (if that many exist) and deletes any blank rows. The remaining rows pre-populate the text portion of the VB inputbox. Short names (like Windows 7 Pro, Windows 7 Home) show 2 on a line, and longer names wrap as shown in my pic. Have not found a way to add vbcrlf, 'r'n or [environment]::Newline to force new rows.

The mechanics of it are sound, but still needs work on the formatting and had planned on re-writing it shorter using some looping logic (which would remove the 15 image limitation of this snippet), but have not found the time.

I troubleshoot single line powershell from .cmd files before going to the registry to make things easier on myself. If you wanted to port back to normal powershell, split rows into readable chunks on the semi-colons ;;;; and then you can run the innards of the -command like normal (and use an IDE for troubleshooting).

$de = Image Index #: The #6 item in the get-wiminfo results array + every 5th item afterwords (6,11,16,etc) is the image index #, save for the last item which is "The operation completed successfully." (removed from array via script)
$ce = Version Name: The #7 item in the get-wiminfo results array + every 5th item afterwords (7,12,17,etc).
$ee = the filtered and formatted "Index#:Name" results that passes to the inputbox. Maybe we should convert this array to an $fe string and manipulate before passing to the input box.

Get-wiminfo-tester.cmd - added some invisible rows to the code box to make it easier to select/copy.
@ECHO OFF
start /wait /b powershell -command "$WIM_FILE = 'A:\install.wim';$de = dism /get-wiminfo /WimFile:$WIM_FILE;$de = $de[6,11,16,21,26,31,36,41,46,51,56,61,66,71,76];$de = @($de | Where-Object {$_ -ne 'The operation completed successfully.'});$de = $de | Foreach-Object {$_ -replace 'Index :', ''};$de = $de | Foreach-Object {$_ -replace ' ', ''};$de;$ce = dism /get-wiminfo /WimFile:$WIM_FILE;$ce = $ce[7,12,17,22,27,32,37,42,47,52,57,62,67,72,77];$ce = @($ce | Where-Object {$_ -ne 'The operation completed successfully.'});$ce = $ce | Foreach-Object {$_ -replace 'Name :', ''};$ce = $ce | Foreach-Object {$_ -replace ' ', ''};$ce = $ce | Foreach-Object {$_ -replace 'WindowsServer', 'Server'};$ce;$ee = ':' , ':',':',':',':',':',':',':',':',':',':',':',':',':',':';$ee[0] = $de[0] + ':' + $ce[0];$ee[1] = $de[1] + ':' + $ce[1];$ee[2] = $de[2] + ':' + $ce[2];$ee[3] = $de[3] + ':' + $ce[3]; $ee[4] = $de[4] + ':' + $ce[4]; $ee[5] = $de[5] + ':' + $ce[5];   $ee[6] = $de[6] + ':' + $ce[6];$ee[7] = $de[7] + ':' + $ce[7];   $ee[8] = $de[8] + ':' + $ce[8];$ee[9] = $de[9] + ':' + $ce[9];   $ee[10] = $de[10] + ':' + $ce[10];$ee[11] = $de[11] + ':' + $ce[11];$ee[12] = $de[12] + ':' + $ce[12];$ee[13] = $de[13] + ':' + $ce[13];$ee[14] = $de[14] + ':' + $ce[14];cls;$ee = @($ee | Where-Object {$_ -ne ':'});$ee;cls;[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic');$INDEX = [Microsoft.VisualBasic.Interaction]::InputBox($ee, 'Which image to mount','1');If ($INDEX -eq '') {exit} Else{Dism /mount-wim /wimfile:$WIM_FILE /index:$INDEX /mountdir:C:\\zMountDir}"





It's hardcoded to A:\Install.wim for testing. But you should be able to drop your %1 in it's place. All the other locations refer to $WIM_FILE once in powershell. I couldn't get it to work from the registry yet, but I've only spent about 5 minutes on that so far (yep you guessed it, it was the 5 minutes before I decided to make this post)

This post has been edited by MrJinje: 27 September 2012 - 12:05 AM


#70 User is offline   MAVERICKS CHOICE 

  • The Guy from Aus
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,693
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 27 September 2012 - 03:55 AM

Great work guys I see were getting somewhere on this now!

#71 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,748
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 28 September 2012 - 09:16 AM

View PostMrJinje, on 26 September 2012 - 10:22 PM, said:

It's hardcoded to A:\Install.wim for testing. But you should be able to drop your %1 in it's place.

Yes I easily added that and it works fine in Win 7
The way it adds is different

Windows 7 install.wim Windows 8 install.wim
Attached File  win7.PNG (10.4K)
Number of downloads: 1Attached File  win8.PNG (8.97K)
Number of downloads: 1

In windows 8 it gets plain ugly and does not add any of the images with UAC ON or OFF
back to the drawing board.
Attached File  Win8_VB.PNG (2.3K)
Number of downloads: 1

This post has been edited by maxXPsoft: 28 September 2012 - 09:29 AM


#72 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,748
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 30 September 2012 - 05:55 AM

I have figured out how to easily get the Powershell to elevate but getting commands to it is where I'm stuck right now
You can see the Administrator: on the PS prompt in Win 7 with UAC ON
Attached File  adminPS.PNG (23.67K)
Number of downloads: 12

#73 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,748
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 October 2012 - 10:21 AM

Excellent - finally got it mostly working on Win 7 and Win 8 even with UAC turned on Fully. :thumbup
Still to do the dism commands to replace Imagex on Win 8

#74 User is offline   MAVERICKS CHOICE 

  • The Guy from Aus
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,693
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 14 October 2012 - 01:16 PM

That's fantastic Max, look forward to it! :thumbup

#75 User is offline   MrJinje 

  • Tool™ Developer
  • Group: Developers
  • Posts: 942
  • Joined: 14-October 09
  • OS:none specified
  • Country: Country Flag

Posted 15 October 2012 - 01:09 PM

Good work max. Check this out, it's a "metro" style rewrite of the old regedit jump trick. Not as nice as yours, but it does the trick.

Got any ideas on how to push a shell ext onto the taskbar /clock area ? Looking for any work-around that is right click available during maximized browser viewing and avoids switching to an explorer window or the desktop to right click.

http://forums.mydigi...rectly-to-a-key

#76 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,748
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 15 October 2012 - 06:31 PM

Attached File  .wimrightclick.png (15.58K)
Number of downloads: 4

New Version today
Windows 7 or Working with Windows 8 and UAC ON or OFF
I used this on my PC and 2 others here that have had UAC ON from day 1 and it is working here. Try it and let me know.

; 9/17/12 Modify Mounting of Image suggestion by MrJinje is now 'Mount RW = Enter Image Index #'
; 10/13/12 Add icons to commands. Rewrite commands using powershell so would work with UAC on. Added Admin shield to powershell.exe
; 10/14/12 Fix Imagex commands. I prefer right now to use Imagex for export cause new dism does it 1 at a time.
;   You can download Imagex.exe and drop in system32 folder as part of Windows Assessment and Deployment Kit (ADK) for Windows® 8
;   Get this download and I just selected deployment tools. http://www.microsoft.com/en-us/download/details.aspx?id=30652
;   A plus to that is you don't need a 1GB + download, was 80mb here and includes WSIM for xml editing. - minus is you need .NET4 ;(
; 10/15/12 Fix Drivers Packages Features To Desktop


Lot of time on this but I kept trying to get powershell to do it with elevated powershell. PS> start-process powershell -verb runAs and passing commands but was not good. 1000 try's later and learning powershell I went back to just adding the Admin icon on powershell.exe and then it elevates asking for permission on systems with UAC ON.

I use Powershell a lot in this release cause it gives me what I need.

Pay attention to my Notes above for Imagex.exe. I have the latest Version: 6.2.9200.16384 and it is in C:\Windows\System32 and works on Win 7 or Win 8
The new Dism does not provide a way to Export all images that I have found yet that is sweet as Imagex.exe /export \"%1\" * to export ALL images in one shot

Download from first post or in my sig as 'Download ++> Se7en/Vista Unattended DVD XML Creator and Application Installer'

EDIT: OMG, I copied that imagex when I had the (ADK) installed and at same time I grabbed the WSIM folder 5.03 MB . I done a image restore. Opened the folder and imgmgr.exe (System Image Manager) works by itself :w00t: no 1.6gb download needed. Just testing a theory cause with SSD I don't like to install excessively huge programs
adksetup.exe (ADK) was 1.16mb and installs about 80mb

This post has been edited by maxXPsoft: 16 October 2012 - 07:55 AM


#77 User is offline   urie 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 517
  • Joined: 30-July 03

Posted 17 October 2012 - 06:30 AM

:lol: oops are reguards to System Image Manager yeah I should have mentioned that a while back all I do is admin install and run it from the folder.

#78 User is offline   MAVERICKS CHOICE 

  • The Guy from Aus
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,693
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 20 October 2012 - 12:07 AM

Hi Max, thanks for the update, all working very well here.

#79 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,748
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 24 October 2012 - 04:49 PM

NEW Update adding able to use your language

; 10/24/12 Updated to use Language from system32\Dism\ dll's. Run the .wimrightclick - Uninstall.reg first.
;   You can modify this to use your language. To change to German (de-DE) just edit ALL "MUIVerb"
;      "MUIVerb"="@%SystemRoot%\\System32\\Dism\\WimProvider.dll,-101"
;        change to
;      "MUIVerb"="@%SystemRoot%\\System32\\Dism\\de-DE\\WimProvider.dll.mui,-101"
;   Must ADD the .mui. I use different dll on some so be carefull

I delayed a little while to get the pop-out where it will have the commands for Mounted Images
NOTE Run the .wimrightclick - Uninstall.reg first

English
Attached File  .wimrightclick.png (16.98K)
Number of downloads: 12

German
Attached File  .wimrightclick_de-DE.png (18.93K)
Number of downloads: 9

EDIT: I re uploaded because found an error in Mount RW = Enter Image Index #\command where /mountdir:C:\\zMountDir was /mountdir:C:\\\\zMountDir. Too many \\

This post has been edited by maxXPsoft: 25 October 2012 - 05:26 PM


#80 User is offline   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 06 March 2013 - 02:33 AM

Thanks maxXPsoft for this awesome registry file! :thumbup

However using French language the text isn't displayed from the ..\fr-FR\DmiProvider.dll.mui (blank line) !

I think it's because there is a return line ( \n) inside the dll

Quote

1110, "Ajoute des packages de pilotes à une image\n hors connexion."


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Add-Driver's]
"MUIVerb"="@%SystemRoot%\\System32\\Dism\\fr-FR\\DmiProvider.dll.mui,-1110"
"Icon"="shell32.dll,-139"



To have the text displayed I set the original text inside the .wimrightclick-Install.reg:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Add-Driver's]
"MUIVerb"="Ajoute des packages de pilotes à une image hors connexion."
"Icon"="shell32.dll,-139"



Regards

Share this topic:


  • 5 Pages +
  • « First
  • 2
  • 3
  • 4
  • 5
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy