Jump to content

AutoIt and Manifest


Recommended Posts

Hi all,

I come to you with a problem I can't solve on my own.

What I want to do is to modify the manifest that is embedded in the executable created by AutoIt (target OS is Win7).

More precisely, I want to add a compatibility section to get rid of the MS Program Compatibility Assistant (PCA) message telling me that the program did not install correctly (triggered by UAC turned on, executable with Setup or Installer in its name and not adding a program). Including Win7 in the supportedOS values prevents the message.

The AutoIt wrapper directive #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator already does modify the manifest, but it seems that the result is hard coded in the wrapper sources and no other fields can be added.

The #AutoIt3Wrapper_Res_File_Add directive does not seem to be what I want - I do not want to include a resource file, but embed it in the executable (not to mention that I do not know if a manifest qualifies as resource).

The manifest tool mt.exe corrupts the executable, the method of modifying a registry key to exclude my program from PCA works only if it is done before program start, changing the name of the exe is not an option... so I'm stuck.

Help would be appreciated, regards

Link to comment
Share on other sites

Thanks for the answer, I'll use your authority to file my task under "can't be done at the moment" :idea: and look for a workaorund for the PCA.

With Windows 7 getting used more often, this might be of interest for other users as well.

So I'll take a bit of time to further look into it and indeed post a feature request once I do not find another way (and get the FR rules right).

Link to comment
Share on other sites

You should be able to edit the manifest with Reshacker, but you must disable UPX in the compiler first.

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

You should be able to edit the manifest with Reshacker, but you must disable UPX in the compiler first.

First tests look promising.

ResHacker has a command line mode to automate the task, UPX is not critical in my task I think, and the resulting exe seems to work.

I'll have to work on it for a bit to extract the existing manifest and merge my changes into it, but this should be enjoyable work compared to not knowing what to do at all. Thanks! I'll post a description of my solution when I get it done.

Link to comment
Share on other sites

I can tell you a solution, use the manifest tool mt.exe to embed a new manifest. That's not really the point of why I asked you to submit a feature request. Creating a work-around which I could have told you from the very beginning is not nearly as beneficial as having the built-in AutoIt toolset supporting the feature.

Link to comment
Share on other sites

First running solution I got uses mt.exe and resource hacker.

I did not get it to work just using mt.exe on the executable. Even on a small and simple script (without FileInstall and UPX), mt.exe did not perform completely and after the modified manifest, only padding values appear in the executable file. Maybe mt.exe expects a format for the executables that is used by Visual Studio, but not by AutoIt? Again, something I know very little about.

So now what I do is

;Turn of compression for reshacker to work
#AutoIt3Wrapper_UseUpx=n
;Switch that will tell AUtoIt wrapper to include ..requestedExecutionLevel level="requireAdministrator".. in the manifest
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
;extract manifest to a file. Probably works with these params only if there is only one resource language (could append 2057 for UK)
#AutoIt3Wrapper_Run_After=""<path to reshacker>\ResHacker.exe"" -extract %out%, Installer.manifest, 24,1,
;use MS tool to merge a custom manifest with the one created by AutoIt
#AutoIt3Wrapper_Run_After=""%VS80COMNTOOLS%\bin\mt.exe"" -manifest Custom.manifest Installer.manifest -out:Installer.manifest
;and use reshacker to put this merged manifest into the exe
#AutoIt3Wrapper_Run_After=""<path to reshacker>\ResHacker.exe"" -addoverwrite %out%, %out%, Installer.manifest, 24,1,

And I completely agree, a built-in solution (not having to worry about getting mt.exe, which is part of Visual Studio and Windows SDK, the version you use, turning off compression for resource hacker, maybe running into strange problems with resource language and whatever...) could be to the benefit of many.

I am currently looking into AutoItWrapper.au3 if I can tweak it for my own use. Lines to create the manifest are straightforward, so I should be able to.

For the feature request, I created Ticket #1595. If you have suggestions that I should add as comment or similar, maybe PM me, I'll try to check my box the next few days. (I am not a regular here, advise is welcome)

Thanks for everyone's time!

Link to comment
Share on other sites

I think, mt.exe just cuts off the appended data from an exe just like the resourceupdate-API (This was a problem when removing reshacker-dependency from the AutoItWrapper, too)

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

  • Developers

And I completely agree, a built-in solution (not having to worry about getting mt.exe, which is part of Visual Studio and Windows SDK, the version you use, turning off compression for resource hacker, maybe running into strange problems with resource language and whatever...) could be to the benefit of many.

I am currently looking into AutoItWrapper.au3 if I can tweak it for my own use. Lines to create the manifest are straightforward, so I should be able to.

I would have no issue updating AutoIt3Wrapper with any change that would facilitate this.

Just thinking of the best approach would be here..

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I would have no issue updating AutoIt3Wrapper with any change that would facilitate this.

Just thinking of the best approach would be here..

I'll continue to reply here if I got an idea, but I'm not sure when - or even if :idea: - I'll find the time to spend on this. That's why I used "personal use".

Link to comment
Share on other sites

  • Developers

I'll continue to reply here if I got an idea, but I'm not sure when - or even if :idea: - I'll find the time to spend on this. That's why I used "personal use".

Just wondering if we should just add a directive that would pick up a file containing the whole new manifest and use that in the resource update routine in AutoIT3Wrapper.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Just wondering if we should just add a directive that would pick up a file containing the whole new manifest and use that in the resource update routine in AutoIT3Wrapper.

The advantage of using a directive to use one complete manifest file would be that the AutoItWrapper would not have to care about ordering the manifest entries. For all (the little) that I know of XML and Microsoft manifests, I could not blame anyone for giving the user responsibility of supplying a well formed manifest, as opposed to trying to build one himself.

If AutoIt needs to make some entries itself, the user would have to take care of that too and put it into the manifest (not sure if this applies). Same would go for requestedExecutionLevel and resource language option that AUtoItWrapper offers. Mixing both approaches - AutoItWrapper reads a manifest file, and merges its entries looks more difficult to me.

With only the requestedExecutionLevel and supportedOS entries in their respective sections, I'd consider ordering the manifest entries a feasable solution. If I understand the wrapper correctly, this would require if switches around the lines that build the temporary manifest file. If feasable, I'd consider this a more pretty solution as an AutoIt user would only have to give one directive and not work with a manifest himself.

Well, a lot of if's..I'd consider..I am not sure that I know all implications of the two possibilities...

Link to comment
Share on other sites

  • Developers

Just saw your feature request in trac and the answer given by Valik so I guess I do not have to worry about it any more.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Don't misconstrue my comment, Jos. I also want Aut2Exe to support changing the elevation level as well yet AutoIt Wrapper has that support. That doesn't mean AutoIt Wrapper shouldn't have the feature in the interim. It simply means the ticket is dumb and is asking for the wrong thing.

Link to comment
Share on other sites

  • 1 year later...
  • Developers

Hi. Any news on this ? I also want to get rid of "Compatibility Assistant" in VISTA/7.

Not sure if this is what you are looking for but I did add the following to the current available Beta version of AutoIt3wrapper:

2.0.1.26 Added #AutoIt3Wrapper_res_compatibility= ;None, Vista, Windows7 or both (default=None)"

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Ok, i install cvsWrapperInst.exe, replace all files with BETA from here: http://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3/

add: #AutoIt3Wrapper_Res_Compatibility=both

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=MirandaAddonAutoInstall4.exe
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#AutoIt3Wrapper_Res_Compatibility=both
#AutoIt3Wrapper_Run_cvsWrapper=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

but after compiling exe, the "Compatibility Assistant" question/popup stil apears :unsure:

Edited by ALIENQuake
Link to comment
Share on other sites

  • Developers

but after compiling exe, the "Compatibility Assistant" question/popup stil apears :unsure:

You are running the Full SciTE4AutoIt4 installer and updated AutoIt3Wrapper with the latest beta? (show the SciTE outputane info of a compile)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

mmm ok see an issue.

it should be:

#AutoIt3Wrapper_res_compatibility=Vista
#AutoIt3Wrapper_res_compatibility=Windows7
#AutoIt3Wrapper_res_compatibility=Vista, Windows7    ; both mentioned ...  not the word both ;)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...