Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

costum restore executeable x64

- - - - -

  • Please log in to reply
18 replies to this topic

#1
Schiiwa

Schiiwa

    Junior

  • Member
  • Pip
  • 77 posts
  • Joined 23-December 10
  • OS:none specified
  • Country: Country Flag
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...576(WS.10).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? :(

Edited by Yzöwl, 16 October 2011 - 10:24 AM.

The only good system is a sound-system !


How to remove advertisement from MSFN

#2
CoffeeFiend

CoffeeFiend

    Coffee Aficionado

  • Super Moderator
  • 5,399 posts
  • Joined 14-July 04
  • OS:Windows 7 x64
  • Country: Country Flag
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).
Coffee: \ˈkȯ-fē, ˈkä-\. noun. Heaven in a cup. Life's only treasure. The meaning of life. Kaffee ist wunderbar. C8H10N4O2 FTW.

#3
Schiiwa

Schiiwa

    Junior

  • Member
  • Pip
  • 77 posts
  • Joined 23-December 10
  • OS:none specified
  • Country: Country Flag

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++
The only good system is a sound-system !

#4
Schiiwa

Schiiwa

    Junior

  • Member
  • Pip
  • 77 posts
  • Joined 23-December 10
  • OS:none specified
  • Country: Country Flag
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
The only good system is a sound-system !

#5
CoffeeFiend

CoffeeFiend

    Coffee Aficionado

  • Super Moderator
  • 5,399 posts
  • Joined 14-July 04
  • OS:Windows 7 x64
  • Country: Country Flag

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:

there is no resource editor included

I thought that was pretty clear...

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!
Coffee: \ˈkȯ-fē, ˈkä-\. noun. Heaven in a cup. Life's only treasure. The meaning of life. Kaffee ist wunderbar. C8H10N4O2 FTW.

#6
Schiiwa

Schiiwa

    Junior

  • Member
  • Pip
  • 77 posts
  • Joined 23-December 10
  • OS:none specified
  • Country: Country Flag

You could have just read what I wrote directly above:


I know

I thought that was pretty clear...


I just found out while u where answering

I didn't.


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

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) ....
The only good system is a sound-system !

#7
CoffeeFiend

CoffeeFiend

    Coffee Aficionado

  • Super Moderator
  • 5,399 posts
  • Joined 14-July 04
  • OS:Windows 7 x64
  • Country: Country Flag

OK, i'll try

Very much appreciated! :thumbup

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.

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.

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.
Coffee: \ˈkȯ-fē, ˈkä-\. noun. Heaven in a cup. Life's only treasure. The meaning of life. Kaffee ist wunderbar. C8H10N4O2 FTW.

#8
Schiiwa

Schiiwa

    Junior

  • Member
  • Pip
  • 77 posts
  • Joined 23-December 10
  • OS:none specified
  • Country: Country Flag

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

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


The application works well under Windows but not under WinRE

Edited by Schiiwa, 16 October 2011 - 07:45 PM.

The only good system is a sound-system !

#9
Schiiwa

Schiiwa

    Junior

  • Member
  • Pip
  • 77 posts
  • Joined 23-December 10
  • OS:none specified
  • Country: Country Flag
The reason which i figured out is, that WOW64 isn´t available for WinPE x64 :(
The only good system is a sound-system !

#10
CoffeeFiend

CoffeeFiend

    Coffee Aficionado

  • Super Moderator
  • 5,399 posts
  • Joined 14-July 04
  • OS:Windows 7 x64
  • Country: Country Flag

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 ;)

And what do u use :sneaky:

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

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)
Coffee: \ˈkȯ-fē, ˈkä-\. noun. Heaven in a cup. Life's only treasure. The meaning of life. Kaffee ist wunderbar. C8H10N4O2 FTW.

#11
Schiiwa

Schiiwa

    Junior

  • Member
  • Pip
  • 77 posts
  • Joined 23-December 10
  • OS:none specified
  • Country: Country Flag
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

Edited by Schiiwa, 16 October 2011 - 09:00 PM.

The only good system is a sound-system !

#12
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,669 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

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
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • Joined 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag

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
Schiiwa

Schiiwa

    Junior

  • Member
  • Pip
  • 77 posts
  • Joined 23-December 10
  • OS:none specified
  • Country: Country Flag

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:

changed the platform to x64 and re-comiled.


Because of the Problem

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

Edited by Schiiwa, 17 October 2011 - 08:52 AM.

The only good system is a sound-system !

#15
Schiiwa

Schiiwa

    Junior

  • Member
  • Pip
  • 77 posts
  • Joined 23-December 10
  • OS:none specified
  • Country: Country Flag
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:

Edited by Schiiwa, 17 October 2011 - 09:52 AM.

The only good system is a sound-system !

#16
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,669 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

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:

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:

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
Schiiwa

Schiiwa

    Junior

  • Member
  • Pip
  • 77 posts
  • Joined 23-December 10
  • OS:none specified
  • Country: Country Flag

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

Edited by Schiiwa, 17 October 2011 - 12:08 PM.

The only good system is a sound-system !

#18
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,669 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

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).

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.

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
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,964 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

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.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users