Frank Schnell Posted November 7, 2006 Share Posted November 7, 2006 Hi, we are using CPAU.exe (http://www.joeware.net/win/free/tools/cpau.htm) to create installation packages which run with administration rights. This way restricted users can install certain software. I tried now to do the same with a compiled AutoIt script. Unfortunately it fails when executing with an error message "(193) Unknown error". As we never had an issue with CPAU in the past two years of usage I expect the error to berelated to AutoIt. We just started to use it. How to reproduce: 1) create a simple AutoIt script foo.au3 with this contents ; Script Start - Add your code below here MsgBox(0,"TITLE","User name: " & @username) 2) compile it to become foo.exe 3) Encode using CPAU using this command line cpau -enc -u <administrator UID> -file install.cpau -ex foo.exe 4) Run wrapped executable cpau -dec -profile -file install.cpau Instead of executing and displaying username an error is being generated Attempting to use job file C:\Documents and Settings\fsc\Desktop\install.cpau Successfully Processed Job File Error: Couldn't create Process: (193) Unknown Error The command did not complete successfully. Did anyone ever successfully use AutiIt compiled scripts with CPAU ? Tx for any help FRank Link to comment Share on other sites More sharing options...
John Posted November 7, 2006 Share Posted November 7, 2006 (edited) Not sure about CPAU but you can do the same thing using AutoIts RunAsSet() function. No need for CPAU. The way I do this is set a command line parameter that when not present tells the autoIt script to RunAsSet() with the proper command line and exit. The new new instance then has the credentials. Edited to add sample code. If $CmdLine <> "/c" RunAsSet("Administrator", @Computername, "adminpassword") Run(@ScriptFullPath & "/c") Exit ;~ Your code to run run under new credentials here ;~ Note that Run() and RunWait do not need the script iself to be run under new credentials. (See Help) Edited November 7, 2006 by John Link to comment Share on other sites More sharing options...
Uten Posted November 7, 2006 Share Posted November 7, 2006 First off: Does your foo.exe run when it has not been "tampered" with by CPAU? Then: Try to compile it without compression. My gut felling tells me it is a conflict between CPAU and UPX. But I have not tested it. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Frank Schnell Posted November 7, 2006 Author Share Posted November 7, 2006 @Uten, Yes, without CPAU it does run without a problem. How do I compile without compression? @John, I have to use CPAU as it does not disclose the password! Link to comment Share on other sites More sharing options...
Uten Posted November 7, 2006 Share Posted November 7, 2006 If you use scite4autoit3 you can use the compiler diretives (scite calls AutoIt3Wrapper.exe witch use the directives). #Region Compiler directives section #compiler_compression = 0 #compiler_OutFile_Type=exe ;a3x #compiler_run_after=move %out% c:\temp\ ;TODO: Put it somewhere ;#compiler_run_after=del /F %out% ;TODO: Or delete it? #endregion If you use aut2exe I think there is a setting in the dialog. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Frank Schnell Posted November 8, 2006 Author Share Posted November 8, 2006 Uten, I am using AutoIt v3 and provided that I understood things correctly I added this code #Region Compiler directives section #compiler_compression = 0 #endregion at the top of my little script and compiled it. It is now 100+ bytes larger. Is that all what compression would be capable of? Unfortunately it still generates that error message. I get the impression AutoIt and CPAU do not work together. Thanks for helping Frank Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now