kid1232 Posted September 21, 2013 Share Posted September 21, 2013 First, SR about my english, its really bad. so i hope you can understand I done my update function, now before update, i use Run() to run setup file My problem is in setup file that i have to kill process of my software is running (i have idea about set process no change when name change (F2) then processclose ) So. My problem is kill process (anyone can change name -> change process name), or make it cannot change name Are you have any idea for me? Thanks a lot Link to comment Share on other sites More sharing options...
jguinch Posted September 21, 2013 Share Posted September 21, 2013 Maybe you can pass the PID as a command line parameter in your Run() call, or set the PID in a environment variable. In your setup, you will have to get the command line parameter or environment variable, and kill the process using the PID. It's just an idea, there is probably an easier way... kid1232 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
kid1232 Posted September 22, 2013 Author Share Posted September 22, 2013 tks bro, but plz can you tell me more details i dont understand all Link to comment Share on other sites More sharing options...
jguinch Posted September 22, 2013 Share Posted September 22, 2013 Well, - To get the PID of your running script, you can use @AutoItPID : it's the Process Identifier of a program, witch is uniq. - To pass a parameter in the command line when calling your setup, you can do Run("setup.exe PID=" & @AutoItPID) - To set an environment variable, just do EnvSet("MyPIP", @AutoItPID) After that, you wil have to get the value in our setup, but I don't know what kind of setup it is (AutoIt, installshield, inno...?) If the setup is an AutoIt script, in can get the value like this : ; For command line parameter If $Cmdine[0] = 1 Then If StringInStr($Cmdine[1], "PID=") Then $PID = StringRegExpReplace($Cmdine[1], ".*PID=(.*)", "$1") ProcessClose($PID) EndIf EndIf ; For environement variable $PID = EnGet("MyPID") If Number($PID) <> 0 Then ProcessClose($PID) Is it good ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF 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