Jump to content











Photo
- - - - -

New API request


  • Please log in to reply
7 replies to this topic

#1 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 07 December 2009 - 03:20 PM

@Pedro,

Can you add a new API command ExtractAndRunAPI

When the host os is x86 (%Wow64%=False), just map to ExtractAndRun,#1,#2,#3,#4
Else, map to something like this:
If,Not,ExistDir,%BaseDir%\Temp,DirMake,%BaseDir%\Temp

 ExtractFile,#1,#2,#3,%BaseDir%\Temp

 System,FILEREDIRECT,OFF

 ShellExecuteex,Open,cmd.exe,"/C #$q%BaseDir%\Temp\#3 #4#$q"

 System,FILEREDIRECT,ON

Peter

#2 paraglider

paraglider

    Gold Member

  • .script developer
  • 1743 posts
  • Location:NC,USA
  •  
    United States

Posted 08 December 2009 - 02:48 AM

Don't think the answer is to switch off file redirection in a 64 bit OS. Think winbuilder needs a way to explicitly request execution of the native executable instead of the 32 bit variation. You don't need to switch of file redirection to do this. Just reference the executable via %SystemRoot%\sysnative.

Suggest a NativeExecuteEx command in winbuilder which on a 32bit os is the same as SystemExecuteEx. On a 64bit OS it executes the 64 bit command.

#3 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 08 December 2009 - 04:20 PM

@Lancelot:

Can you check whether theory is identic to practice?
Please check on your x64 host whether Paraglider's suggestion works for you?

Peter

#4 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 08 December 2009 - 05:17 PM

Don't think the answer is to switch off file redirection in a 64 bit OS. Think winbuilder needs a way to explicitly request execution of the native executable instead of the 32 bit variation. You don't need to switch of file redirection to do this. Just reference the executable via %SystemRoot%\sysnative.

Suggest a NativeExecuteEx command in winbuilder which on a 32bit os is the same as SystemExecuteEx. On a 64bit OS it executes the 64 bit command.

Your suggestion sounds interesting, but I have some troubles to combine with the current question:
Here on executing <something.EXT>, the x64 app associated to EXT should be started.
(Remember that the associations theoretically can be different for x86 and x64, and are stored in different registry keys)
How to do it using %SystemRoot%\sysnative?

Peter

#5 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 08 December 2009 - 07:20 PM

@Lancelot:

Can you check whether theory is identic to practice?
Please check on your x64 host whether Paraglider's suggestion works for you?


Sorry, my knowledge is not enough to understand fully the theory.

#6 paraglider

paraglider

    Gold Member

  • .script developer
  • 1743 posts
  • Location:NC,USA
  •  
    United States

Posted 09 December 2009 - 02:31 AM

For executing the file associated with an extension then you are correct its easier to switch off file and registry redirection. You would need to switch off both to get the 64 bit associations.

#7 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 01 January 2010 - 10:58 AM

Hi all,

Since there is no new thing about the topic, I decide to follow psc's and galapo's ideas with capi (here)

[Api_Def]
..
..
%APISUBDEF%=..........,ExtractAndRun

[ApiVar]
...
ExtractAndRun=Run,%API%,Extract_And_Run
...
[Extract_And_Run]
If,Not,ExistVar,%GlobalTemp%,Set,%GlobalTemp%,%BaseDir%\Temp
If,Not,ExistDir,%GlobalTemp%,DirMake,%GlobalTemp%
ExtractFile,#1,#2,#3,%GlobalTemp%
System,FILEREDIRECT,OFF
ShellExecuteex,Hide,cmd.exe,"/C #$q%GlobalTemp%\#3#$q",%GlobalTemp%
System,FILEREDIRECT,ON


:)

#8 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 01 January 2010 - 09:43 PM

Thanks, Lancelot!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users