MSFN Forum: costum restore executeable x64 - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

costum restore executeable x64 to call the specified HTA and includes the ICON and DESCRIPTION Rate Topic: -----

#1 User is offline   Schiiwa 

  • Junior
  • Pip
  • Group: Members
  • Posts: 74
  • Joined: 23-December 10
  • OS:none specified
  • Country: Country Flag

Posted 16 October 2011 - 09:04 AM

This is the Vista´s code:

#include"stdafx.h"
#include"windows.h"


int _tmain(int argc, _TCHAR* argv[])
{


ShellExecute(NULL,_T("open"),_T("x:\\Windows\\System32\\Mshta.exe"),_T("x:\\sources\\recovery\\tools\\CostumRestore.hta"),NULL,SW_SHOW);


return 0;
} 


As i read from the TechNet...
http://technet.micro...28WS.10%29.aspx
Windows 7 Recovery Environment extracts the ICON for the options-menu from the Executeable. Vista takes it from OEMFactoryRestore.hta.

As I read in Creating_a_Windows_Vista_Hard_Disk_Recovery_Solution.pdf, the Icon and Description can be included :w00t:

I will try to build an EXE compatible for Windows 7 x64.... But i have no experiences with C++ :lol: . I just did an dos-programm with Turbo C++, but i just could accomplish with help.

I am installing MS Visual C++ Express right now. Do not know, if the *.h files are available there... Let´s see :rolleyes:

Will update when i have tryed it

<Edit />

1. Problem:

Can´t add a "Resource File" as discribed in Creating_a_Windows_Vista_Hard_Disk_Recovery_Solution.pdf

Is that a limitation of Visual C++ Express? :(

This post has been edited by Yzöwl: 16 October 2011 - 10:24 AM



#2 User is offline   CoffeeFiend 

  • Coffee Aficionado
  • Group: Super Moderator
  • Posts: 5,399
  • Joined: 14-July 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 16 October 2011 - 10:19 AM

Visual C++ Express Edition is very limited (none of the MFC/ATL/WTL bits for starters), and indeed, there is no resource editor included. It's by far the most limited of all the "Express Edition" compilers.

Then again, if you're new to programming then perhaps using C++ isn't the best choice. Any programming language will let you do this easily (use ShellExecute on that HTA). You're making this a lot harder than it has to be (unless this runs under WinPE which very much narrows down your choices).

#3 User is offline   Schiiwa 

  • Junior
  • Pip
  • Group: Members
  • Posts: 74
  • Joined: 23-December 10
  • OS:none specified
  • Country: Country Flag

Posted 16 October 2011 - 10:29 AM

View PostCoffeeFiend, on 16 October 2011 - 10:19 AM, said:

Visual C++ Express Edition is very limited (none of the MFC/ATL/WTL bits for starters), and indeed, there is no resource editor included. It's by far the most limited of all the "Express Edition" compilers.

Then again, if you're new to programming then perhaps using C++ isn't the best choice. Any programming language will let you do this easily (use ShellExecute on that HTA). You're making this a lot harder than it has to be (unless this runs under WinPE which very much narrows down your choices).



Just wanted to add:
EDIT:
JUST FOUND:

Visual C++ Express editions don't have a resource editor. That is one of its limitations. :realmad:


But i need a executeable with a valid description and icon to display my EXE in the recovery-options-menu when i boot to winre... And the only code i found was c++

#4 User is offline   Schiiwa 

  • Junior
  • Pip
  • Group: Members
  • Posts: 74
  • Joined: 23-December 10
  • OS:none specified
  • Country: Country Flag

Posted 16 October 2011 - 11:11 AM

My brother is in a computer science apprenticeship.... he is able to compile for me :thumbup


Let´s see, if it will success


BTW.: Why did you edit my post CoffeeFiend. And why are you a coffeefiend :o

#5 User is offline   CoffeeFiend 

  • Coffee Aficionado
  • Group: Super Moderator
  • Posts: 5,399
  • Joined: 14-July 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 16 October 2011 - 11:37 AM

View PostSchiiwa, on 16 October 2011 - 10:29 AM, said:

Visual C++ Express editions don't have a resource editor. That is one of its limitations. :realmad:

You could have just read what I wrote directly above:

View PostCoffeeFiend, on 16 October 2011 - 10:19 AM, said:

there is no resource editor included

I thought that was pretty clear...

View PostSchiiwa, on 16 October 2011 - 11:11 AM, said:

Why did you edit my post CoffeeFiend

I didn't.

Please stop using the acute accent (´) as if it's some sort of single quote!

#6 User is offline   Schiiwa 

  • Junior
  • Pip
  • Group: Members
  • Posts: 74
  • Joined: 23-December 10
  • OS:none specified
  • Country: Country Flag

Posted 16 October 2011 - 07:09 PM

View PostCoffeeFiend, on 16 October 2011 - 11:37 AM, said:

You could have just read what I wrote directly above:


I know

View PostCoffeeFiend, on 16 October 2011 - 10:19 AM, said:

I thought that was pretty clear...


I just found out while u where answering

View PostCoffeeFiend, on 16 October 2011 - 10:19 AM, said:

I didn't.


Strange... thought i've read "This post has been edited by CoffeeFiend" ...Now it has been edited by Yzöwl :wacko:

View PostCoffeeFiend, on 16 October 2011 - 10:19 AM, said:

Please stop using the acute accent (´) as if it's some sort of single quote!


OK, i'll try


Now my brother has compiled the EXE and it works fine, but just in the normal OS... When I boot to WinRE, it says something about a missing subsystem. I guess it is because of the wrong architecture. My WinRE is x64, but the Application created with Visual C++ is an Win32-Application :realmad:

The Recovery-Environment does well with the Icon and Description, but when i click on the option, a window pops up that there´s something wrong!

When I open the CMD and try to run, it returns the error with the missing subsystem! ... Now got stuck ... No idea how to continue :}


I Also tryed to compile the EXE with
Quick Batch File Compiler


Like robbo101 here:
http://www.msfn.org/...post__p__765687

But with the same result (missing subsystem) ....

#7 User is offline   CoffeeFiend 

  • Coffee Aficionado
  • Group: Super Moderator
  • Posts: 5,399
  • Joined: 14-July 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 16 October 2011 - 07:19 PM

View PostSchiiwa, on 16 October 2011 - 07:09 PM, said:

OK, i'll try

Very much appreciated! :thumbup

View PostSchiiwa, on 16 October 2011 - 07:09 PM, said:

Now my brother has compiled the EXE and it works fine, but just in the normal OS... When I boot to WinRE, it says something about a missing subsystem.

Chances are that it's compiled in a way that requires you to install the Visual C++ redist first.

View PostSchiiwa, on 16 October 2011 - 07:09 PM, said:

I guess it is because of the wrong architecture. My WinRE is x64, but the Application created with Visual C++ is an Win32-Application :realmad:

No. 32 bit apps work fine on a 64 bit OS.

View PostSchiiwa, on 16 October 2011 - 07:09 PM, said:

The Recovery-Environment does well with the Icon and Description, but when i click on the option, a window pops up that there´s something wrong!

When I open the CMD and try to run, it returns the error with the missing subsystem! ... Now got stuck ... No idea how to continue :}

If you paste the actual error message (even if it's not in english) then we might know what the problem is for sure. It could be a number of other things, like your app working fine but WinRE not supporting HTA files (not having the winpe-hta package built-in). Not that I use WinRE or WinPE.

#8 User is offline   Schiiwa 

  • Junior
  • Pip
  • Group: Members
  • Posts: 74
  • Joined: 23-December 10
  • OS:none specified
  • Country: Country Flag

Posted 16 October 2011 - 07:33 PM

View PostCoffeeFiend, on 16 October 2011 - 07:19 PM, said:

If you paste the actual error message (even if it's not in english) then we might know what the problem is for sure. It could be a number of other things, like your app working fine but WinRE not supporting HTA files (not having the winpe-hta package built-in). Not that I use WinRE or WinPE.


This was really a fast answer ....

NOPE, HTA works well. I can call any hta with "MSHTA.EXE somehta.hta"

The actual massage, when i try to run the executeable via CMD, this will return:

The subsystem needed to support the image type is not present
Das zum Unterstützen des Abbildtyps erforderliche Subsystem ist nicht vorhanden.



Yeah... I can offer u 2 languages :lol:

And what do u use :sneaky:

EDIT

View PostCoffeeFiend, on 16 October 2011 - 07:19 PM, said:

No. 32 bit apps work fine on a 64 bit OS.


The application works well under Windows but not under WinRE

This post has been edited by Schiiwa: 16 October 2011 - 07:45 PM


#9 User is offline   Schiiwa 

  • Junior
  • Pip
  • Group: Members
  • Posts: 74
  • Joined: 23-December 10
  • OS:none specified
  • Country: Country Flag

Posted 16 October 2011 - 08:06 PM

The reason which i figured out is, that WOW64 isn´t available for WinPE x64 :(

#10 User is offline   CoffeeFiend 

  • Coffee Aficionado
  • Group: Super Moderator
  • Posts: 5,399
  • Joined: 14-July 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 16 October 2011 - 08:29 PM

View PostSchiiwa, on 16 October 2011 - 07:33 PM, said:

The subsystem needed to support the image type is not present
Das zum Unterstützen des Abbildtyps erforderliche Subsystem ist nicht vorhanden.



Yeah... I can offer u 2 languages :lol:

That's ok. Ich spreche ein bisschen Deutsch ;) Et français aussi ;)

View PostSchiiwa, on 16 October 2011 - 07:33 PM, said:

And what do u use :sneaky:

Instead of WinRE? Nothing. I simply don't have a use for it.

View PostSchiiwa, on 16 October 2011 - 08:06 PM, said:

The reason which i figured out is, that WOW64 isn´t available for WinPE x64 :(

Ouch. Didn't see that one coming as I don't use WinPE or WinRE. But yeah, it's pretty limited -- no .NET framework built-in either. The good news is recompiling should fix that (or using the 32 bit version of WnPE)

#11 User is offline   Schiiwa 

  • Junior
  • Pip
  • Group: Members
  • Posts: 74
  • Joined: 23-December 10
  • OS:none specified
  • Country: Country Flag

Posted 16 October 2011 - 08:51 PM

I already made it. After a little bit of googeling and taking over my brothers PC with remote-desktop i changed the platform to x64 and re-comiled.

2 Files were missing and after I implemented them into X:\Windows\System32 all works fine! :thumbup

Just have to edit the HTA-script for my needs :w00t:

I personally like a recovery-option because I have installed windows enough! I think more often than a normal user would in 10 lifes :rolleyes:

But this computer i am preparing is for my little brother (15 years) and I know what's gonna happen :angel

I will copy the nessessary partitions also to another disk, because i had some hdd-crashes also and this one isn´t new

This post has been edited by Schiiwa: 16 October 2011 - 09:00 PM


#12 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,457
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 17 October 2011 - 03:57 AM

View PostSchiiwa, on 16 October 2011 - 08:51 PM, said:

I already made it. After a little bit of googeling and taking over my brothers PC with remote-desktop i changed the platform to x64 and re-comiled.

2 Files were missing and after I implemented them into X:\Windows\System32 all works fine! :thumbup


Are you going to post WHICH EXACTLY "2 files" were missing? :w00t:
Or do we need to apply some torture to extort you this information? :ph34r:
Boy, do I hate reports of success that completely FAIL to detail HOW EXACTLY the goal was reached.... :realmad:

jaclaz

#13 User is offline   Geej 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 634
  • Joined: 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag

Posted 17 October 2011 - 07:00 AM

View Postjaclaz, on 17 October 2011 - 03:57 AM, said:

Or do we need to apply some torture to extort you this information? :ph34r:

i love this option but is it against MSFN forum rules? (LOL :D )

#14 User is offline   Schiiwa 

  • Junior
  • Pip
  • Group: Members
  • Posts: 74
  • Joined: 23-December 10
  • OS:none specified
  • Country: Country Flag

Posted 17 October 2011 - 08:27 AM

View Postjaclaz, on 17 October 2011 - 03:57 AM, said:

Boy, do I hate reports of success that completely FAIL to detail HOW EXACTLY the goal was reached....


HERE AGAIN FOR THE GRAND MASTER JAYCLAZ:

View PostSchiiwa, on 16 October 2011 - 08:51 PM, said:

changed the platform to x64 and re-comiled.


Because of the Problem

View PostSchiiwa, on 16 October 2011 - 08:51 PM, said:

The reason which i figured out is, that WOW64 isn´t available for WinPE x64


Don´t be rude my friend. I didn´t write in here EXACTLY the 2 files, because you will be informed through the executeable..... But If you want details...here we go!

First it said:

mfc100u.dll not found


and after placing it from C:\Windows\System32 into the RE-image:\Windows\System32 (as we all here know, which has normally the letter "X" assigned), the next message was:

msvcr100.dll not found


Then same procedure.... and ta-da.... The HTA was Popping up. And I didn´t write these details, because I am sure it hurts some copyrights :ph34r: because nearly everything is illegal. If MS haven´t changed the EULA of IMAGEX, i am not allowed to do a Image of my OS-Partition, right Jayclaz??
http://www.msfn.org/...post__p__954690


Maybe (but do not know) these files went to C:\Windows\System32 through the installation of Visual C++ (on my brothers Computer). But Maybe they are some standard WIN-Files

BTW... here´s the source-code
#include "stdafx.h"
#include "windows.h"
int _tmain(int argc, _TCHAR* argv[])
{
ShellExecute(NULL,_T("open"),_T("x:\\Windows\\System32\\Mshta.exe"),_T("x:\\sources\\recovery\\tools\\RestoreImage.hta"),NULL,SW_SHOW);
return 0;
}


And I saw the possibilities of Visual C++ the first time and was really flashed. So in my opinion, if someone buys and gets along with this programm, they already know the option to change the platform! It´s just because i have no idea of programming in C++

Additional Information: :w00t: :w00t: :w00t: :w00t: :w00t: :w00t:
You can change the platform in Visual C++ by opening the properties of your projekt and search for KONFIGURATION MANAGER!!!!!!!!!!!!!!!!!!

Win32, X64 and Itanium will be available. As this box here holds an AMD, i chose x64

This post has been edited by Schiiwa: 17 October 2011 - 08:52 AM


#15 User is offline   Schiiwa 

  • Junior
  • Pip
  • Group: Members
  • Posts: 74
  • Joined: 23-December 10
  • OS:none specified
  • Country: Country Flag

Posted 17 October 2011 - 09:11 AM

Not all tests finished yet

one Problem left:
I did this one:
C:\Windows\System32\Reagentc.exe /setosimage /path Z:\ /target C:\Windows


My costum-tool is displayed without specified the /costumtool-parameter. I´ve just specified my costum exe in WinREConfig.xml. That´s OK, but how can I remove the option at the bottom now (Reinstall Windows) ???

when I do:
reagentc /info


Setup activated = 1

how can i reset it to 0

I´ve just ran:
C:\Windows\System32\Reagentc.exe /setosimage /customtool /target C:\Windows


But still Setup activated = 1 .... I'll reboot now and see the effects

SOLVED: The command directly above will hide the "Reinstall Windows" option, even though "Setup activated = 1" will leave

Wonderful... all works fine (UNTIL NOW.... not ran the HTA till now... have to edit some things first). I´ll also add the BOOTKEY for /SETREIMAGE to F11, because the other PCs where my brother lives have the Acronis Boot loader installed, which can be activated with F11 :whistle: Would be interesting, if F8 would be available anyway!? :sneaky:

Maybe I will reinstall windows again, to create the ID=27 Recovery-Partition. But I think I will keep that back for my own PC/Notebook and simply deactivate the access through windows with:
ATTRIBUTE VOLUME SET NODEFAULTDRIVELETTER=1
Maybe also HIDDEN=1 and READONLY=1, but don´t know if it is possible to boot to win-re then.... we´ll see


Cy@ soon in a HTA-Threat :lol:

This post has been edited by Schiiwa: 17 October 2011 - 09:52 AM


#16 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,457
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 17 October 2011 - 10:02 AM

View PostSchiiwa, on 17 October 2011 - 08:27 AM, said:

Then same procedure.... and ta-da.... The HTA was Popping up. And I didn´t write these details, because I am sure it hurts some copyrights :ph34r: because nearly everything is illegal. If MS haven´t changed the EULA of IMAGEX, i am not allowed to do a Image of my OS-Partition, right Jayclaz??
http://www.msfn.org/...post__p__954690


That's the interesting point, as long as you do this for recovery purposes AND NOT for purposes of backing up your Windows operating system:

Quote

ImageX.exe, Wimapi.dll, Wimfilter and Package Manager. You may install and use the ImageX.exe, Wimapi.dll and Wimfilter and Package Manager portions of the software for recovering Windows operating system software. For the avoidance of doubt, you may not use these portions of the software for any other purpose, including without limitation for purposes of backing up your Windows operating system.

you are OK. :whistle:

After 4 (four) years :w00t: noone ever attempted to explain that to me, though, so I am still in my primitive (possible mis-) understanding of the matter :unsure::
http://www.911cd.net...ic=19355&st=134

Thanks for the more detailed report :thumbup , but now that you are in the right mood:

View PostSchiiwa, on 17 October 2011 - 08:27 AM, said:

BTW... here´s the source-code
#include "stdafx.h"
#include "windows.h"
int _tmain(int argc, _TCHAR* argv[])
{
ShellExecute(NULL,_T("open"),_T("x:\\Windows\\System32\\Mshta.exe"),_T("x:\\sources\\recovery\\tools\\RestoreImage.hta"),NULL,SW_SHOW);
return 0;
}



why don't you make that thingy as a compiled executable both 32 and 64 bit and additionally post the compiled app? :angel
(and possibly add to it your .hta?) :yes:

jaclaz

#17 User is offline   Schiiwa 

  • Junior
  • Pip
  • Group: Members
  • Posts: 74
  • Joined: 23-December 10
  • OS:none specified
  • Country: Country Flag

Posted 17 October 2011 - 11:22 AM

View Postjaclaz, on 17 October 2011 - 10:02 AM, said:

why don't you make that thingy as a compiled executable both 32 and 64 bit and additionally post the compiled app? :angel


Give me a larger storage and i will post it :angel

EDIT: Problem:
Just can compile either Win32 or x64 ... do not know how to include both in one file!

Itanium won´t work also:
Compiling for unsupported platform. Only x86 and x64 platforms are supported by MFC.

I thought Itanium is for Intel-CPUs, that is IA64 (for example i3/i5/i7) ... but maybe the x64 work for these cpus also :rolleyes:

It work without these 2 DLL as i now changed the setting in MFC from "Use MFC in common shared DLL" in "Use MFC in static libary". This will enlarge the EXE from 12kb to 2mb :whistle: I could zip it to about 700 kb, but my web-space here is only about 500kb free


HTA will follow when completed

This post has been edited by Schiiwa: 17 October 2011 - 12:08 PM


#18 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,457
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 17 October 2011 - 01:04 PM

View PostSchiiwa, on 17 October 2011 - 11:22 AM, said:

Just can compile either Win32 or x64 ... do not know how to include both in one file!

Sure, sorry for the misunderstanding I meant TWO compiled apps, \x32\myniceapp.exe and \x64\myniceapp.exe (or whatever).

View PostSchiiwa, on 17 October 2011 - 11:22 AM, said:

It work without these 2 DLL as i now changed the setting in MFC from "Use MFC in common shared DLL" in "Use MFC in static libary". This will enlarge the EXE from 12kb to 2mb :whistle: I could zip it to about 700 kb, but my web-space here is only about 500kb free

Maybe you could then provide FOUR :ph34r: of them, two statically linked and two using the .dll's.

View PostSchiiwa, on 17 October 2011 - 11:22 AM, said:

HTA will follow when completed

No hurry whatsoever. :)
When and if you'll be ready, you can upload it to zshare or hotfile or the like and then I can get them and attach 'em to a post on MSFN (I don't know how much space you have available as you have a relatively low number of posts).
Or you could contact any of the Mods/Admins and see if they can enlarge your upload quota.

jaclaz

#19 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,690
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 18 October 2011 - 09:19 AM

View Postjaclaz, on 17 October 2011 - 01:04 PM, said:

Or you could contact any of the Mods/Admins and see if they can enlarge your upload quota.

jaclaz


It would be easier to put it up someplace that has free hosting like SkyDrive.

Share this topic:


Page 1 of 1
  • 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