AutoHotkey Community

It is currently May 27th, 2012, 10:27 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 414 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12, 13 ... 28  Next
Author Message
 Post subject:
PostPosted: December 20th, 2008, 3:01 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
ladiko wrote:
cmdret isnt added atm, but i think it is also simpler to handle / understand the script code. cause cmdret uses a parameter for the working dir, i could cut all pathes and hopefully get a cmd-line that is short enough for win9x. i hope i get it to work tomorrow.
As far as I understand, CMDret is effective for getting logs. The problem with having the script recognize hidden processes and wait for them to finish may still be there and that is what blocked me from successfully adapting the script to 9x.

Anyway, I'll have to revise what I've done so far and try to get it back to a functional form including the current changes. If only the day still had 24 hours...

_________________
AHK tools by Drugwash (AHK 1.0.48.05 and Win98SE)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2008, 5:03 pm 
Offline

Joined: July 14th, 2006, 12:31 am
Posts: 290
Location: Berlin
i test it with a reshacker script that includes f.e. 10000 resources and take look how long it lasts and if the cmdret finishes immediatly or after the time for the 1000 resources.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2008, 6:23 pm 
Offline

Joined: February 20th, 2008, 5:08 pm
Posts: 111
ladiko wrote:
blank passwords are never an option. increasing the systems security by working with an unprivileged user account is a good idea, but raising the convenience by having an administrator with a blank password is ineffectual.

I'm not talking about system security, I don't care about that. This is a simple, small application, but it uses a command that requires Run as admin.
I'm sorry to hear that I've got to stop developing the app because of this minor detail :(


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2008, 6:53 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
ladiko wrote:
i test it with a reshacker script that includes f.e. 10000 resources and take look how long it lasts and if the cmdret finishes immediatly or after the time for the 1000 resources.
I tested with the actual ResHacker scripts created by Compile_AHK (ChangeIcon and ChangeVersionInfo). Both are run correctly, in ~400-550ms. Problem is, I'm not getting any kind of output from the CMDret function. :( Shouldn't I get something? :?

Here's the test code I used; both cmd_out1 and cmd_out2 remain null:
Code:
cmd_in := "reshacker.exe -script ChangeIcon.script"
t1 := A_TickCount
cmd_out1 := CMDret_RunReturn(cmd_in)
cmd_in := "reshacker.exe -script ChangeVersionInfo.script"
cmd_out2 := CMDret_RunReturn(cmd_in)
t2 := A_TickCount - t1
wtime := TConv(t2)
MsgBox, Operation finished in %wtime% (%t2%ms)`nExecuted: %cmd_out1%`nExecuted: %cmd_out2%

GuiClose:
ExitApp


; Conversion function below borrowed from the Music Player script,
; fixed by an AHK member whose name I forgot
; and adapted by me for showing ms.

TConv(milli)
{
   hour := Floor(milli / 3600000)
   hour := hour < 10 ? "0" . hour : hour
   min  := Mod(Floor(milli / 60000), 60)
   min := min < 10 ? "0" . min : min
   sec  := Mod(Floor( milli / 1000), 60)
   sec := sec < 10 ? "0" . sec : sec
   msec  := Mod(milli, 1000)
   msec := msec < 100 ? "0" . msec : msec
   msec := msec < 10 ? "0" . msec : msec
   Return hour "h" min "m" sec "s" msec "ms"
}

#include cmdret_ahk.ahk

_________________
AHK tools by Drugwash (AHK 1.0.48.05 and Win98SE)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2008, 12:50 am 
Offline

Joined: July 14th, 2006, 12:31 am
Posts: 290
Location: Berlin
@drugwash:
we are a little bit blind :-)
in the case of reshacker "%comspec% /c" isnt needed, cause it doesnt produce an output to stdout. this is also the reason why there is no > %Working_dir%\whatever.log. reshacker produces a reshacker.log as output and that is read after reshacker has finished. this means we can call reshacker without %comspec%. i post my result later.

@nozavi: could you explain why this app needs runas and i will try to find a solution?!? there must be a reason why it cannot be called directly by another user. access rights? what do you want the script to do?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2008, 2:09 am 
Offline

Joined: February 20th, 2008, 5:08 pm
Posts: 111
ladiko wrote:
@nozavi: could you explain why this app needs runas and i will try to find a solution?!? there must be a reason why it cannot be called directly by another user. access rights? what do you want the script to do?

Easy, an uploader using the example from FileAppend


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2008, 4:15 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
ladiko wrote:
in the case of reshacker "%comspec% /c" isnt needed, cause it doesnt produce an output to stdout. this is also the reason why there is no > %Working_dir%\whatever.log. reshacker produces a reshacker.log as output and that is read after reshacker has finished. this means we can call reshacker without %comspec%.
Yes, I know ResHacker produces its own log; as you see, there's no comspec call in my test code above. However, it overwrites rather than appending, which makes reading the log a bit difficult.

I come to wonder if this detailed log is really necessary or it's just a debugging help. After all, the most important thing is having the actions performed as designed. Still, it would help if CMDret would return some kind of error code, either for success or for failure, so we could further know what actions to take. Relying on a line of text in another application's log does not look very reliable to me.

Also let's not forget about GoRC; I haven't tested that one yet so dunno if it produces its own log and if we can rely on it for success/failure recognition. What's it useful for, anyway? Just for .rc to .res conversion? I'd rather have the script export the original VersionInfo through ResHacker, delete the original (codepage 1033), modify the export through a File parsing loop and then import it back also through ResHacker. This would take GoRC out of the picture - one less trouble.

What do you say, does that sound reasonable?

_________________
AHK tools by Drugwash (AHK 1.0.48.05 and Win98SE)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2008, 4:51 pm 
Offline

Joined: July 14th, 2006, 12:31 am
Posts: 290
Location: Berlin
Yes the log is only for debugging. You can use different Reshacker logs if you apply a change to ChangeIcon.script and/or ChangeVersionInfo.script:
[FILENAMES]
Exe=%WhatEver%\AutoHotkeySC.bin
SaveAs=%WhatEver%\AutoHotkeySC.bin
Log=%WhatEver%\ResHacker_Whatever.log

If i change
Code:
s_SCRIPT := s_SCRIPT . "-addoverwrite """ . A_WorkingDir . "" . s_RES_FILE . """ , Versioninfo , 1 , `n"
to
Code:
s_SCRIPT := s_SCRIPT . "-addoverwrite """ . A_WorkingDir . "" . s_RC_FILE . """ , Versioninfo , 1 , `n"
i get the following error message from reshacker:
Code:
...
-addoverwrite "C:\Users\User\AppData\Local\Temp\AutoHotkey\Compiler\VersionInfo.rc" , Versioninfo , 1 ,

Error: Invalid resource type.


Nozavi wrote:
Easy, an uploader using the example from FileAppend
so you wanna call ftp.exe with administrative rights to open the windows firewall?

does the code in the second post help you? -> Support for UAC


Last edited by ladiko on December 21st, 2008, 7:33 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2008, 6:26 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
Yep, apparently there's a limitation/bug in ResHacker that it can't import .rc resources. Dang! :(

_________________
AHK tools by Drugwash (AHK 1.0.48.05 and Win98SE)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2008, 7:26 pm 
Offline

Joined: July 14th, 2006, 12:31 am
Posts: 290
Location: Berlin
it's not the only bug :-)
Code:
; --------------------------------------------------------------------------------
; ResHacker-fix: cause the following command doesn't work:
; ResHacker.exe -addoverwrite , in.exe , out.exe , version.res , versioninfo , 1 , 1033
; the versioninfo with language ID 1033 has to be deleted to prevent double versioninfo
; --------------------------------------------------------------------------------
   s_SCRIPT := s_SCRIPT . "-delete Versioninfo , 1 , 1033`n"


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2008, 11:49 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
Well, files allow multi-language resources (except for 9x usage) so that's a collateral issue. However, it's more frustrating not being able to use .rc resources directly with ResHacker. At some point, an ASM patching solution crossed my mind but I'm quite out of hand at that lately.

_________________
AHK tools by Drugwash (AHK 1.0.48.05 and Win98SE)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 23rd, 2008, 2:27 pm 
Offline

Joined: February 20th, 2008, 5:08 pm
Posts: 111
ladiko wrote:
Nozavi wrote:
Easy, an uploader using the example from FileAppend
so you wanna call ftp.exe with administrative rights to open the windows firewall?

does the code in the second post help you? -> Support for UAC

Nope, not really... :(
I was thinking of adding ftp.exe as launched by my app to the firewall exception list, in the registry, but it registers itself with different names, for example:
TCP Query User{027A77A8-5FC4-44F0-B4E4-67592082A7C0}C:\windows\system32\ftp.exe
UDP Query User{8137F059-C09A-485E-BBBD-B21687766377}C:\windows\system32\ftp.exe
or
TCP Query User{A0CE2809-D8AE-4B94-BCF0-314F3FF6F7A9}C:\windows\system32\ftp.exe
UDP Query User{16E0F2E4-831E-4328-96B2-720DF5EC4672}C:\windows\system32\ftp.exe

and I don't understand how it generates that ID... even adding ftp.exe stand-alone results in different names (IDs)...
So... running out of ideas...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 23rd, 2008, 4:08 pm 
Offline

Joined: July 14th, 2006, 12:31 am
Posts: 290
Location: Berlin
use the prefered way via command line:
Configure Windows Firewall using command line - Step 2. Windows Firewall: Exceptions


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 23rd, 2008, 5:18 pm 
Offline

Joined: February 20th, 2008, 5:08 pm
Posts: 111
ladiko wrote:


C:\Users\Nozavi\Desktop>netsh firewall add allowedprogram program=C:\Windows\system32\ftp.exe
The syntax supplied for this command is not valid. Check help for the correct syntax.

wtf :?:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 23rd, 2008, 5:40 pm 
Offline

Joined: July 14th, 2006, 12:31 am
Posts: 290
Location: Berlin
take a look at the example command lines


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 414 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12, 13 ... 28  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: XX0 and 21 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group