Subz Posted February 21, 2017 Share Posted February 21, 2017 You just need to register the dll with /s if its not registered it will register it and if it is it won't do anything. Link to comment Share on other sites More sharing options...
Nursultan Posted February 21, 2017 Author Share Posted February 21, 2017 if it is it won't do anything don't understand Link to comment Share on other sites More sharing options...
Subz Posted February 21, 2017 Share Posted February 21, 2017 RegSvr32 will check to see if it's registered or not, if it is registered it won't reregister it twice it will just exit. Link to comment Share on other sites More sharing options...
Nursultan Posted February 21, 2017 Author Share Posted February 21, 2017 how to write in script? I don't understand these situation just write ? RunWait(@ScriptDir & '\mybat.bat') Link to comment Share on other sites More sharing options...
Subz Posted February 21, 2017 Share Posted February 21, 2017 My script above does everything within your batch, if you want to just run the batch you can use ShellExecute(@ScriptDir & '\mybat.bat') or you could use RunWait(@Comspec & ' /c "' & @ScriptDir & '\mybat.bat"', '', @SW_HIDE) Link to comment Share on other sites More sharing options...
Nursultan Posted February 21, 2017 Author Share Posted February 21, 2017 ок understand)) Link to comment Share on other sites More sharing options...
Nursultan Posted February 21, 2017 Author Share Posted February 21, 2017 #RequireAdmin RunWait(@ComSpec & ' /c regsvr32 "' & @ScriptDir & '\iDocsDll.dll" /s', '', @SW_HIDE) RunWait(@ComSpec & ' /c regsvr32 "' & @ScriptDir & '\KalkanCryptCOM.dll" /s', '', @SW_HIDE) Local $DotNetFx = @WindowsDir & '\Microsoft.NET\Framework\v4.0.30319\regasm.exe' If FileExists($DotNetFx) Then RunWait(@ComSpec & ' /c "' & $DotNetFx & '" /codebase /tlb "' & @ScriptDir & '\NC.dll" /silent', '', @SW_HIDE) Else MsgBox(64, 'Error', 'Unable to detect: ' & $DotNetFx) EndIf ;Message Box about finishing MsgBox(0, 'done') it does not work, no msgbox Link to comment Share on other sites More sharing options...
Subz Posted February 21, 2017 Share Posted February 21, 2017 (edited) Run it from within Scite and look at the console which should give you what errors if any it returns. Actually that won't work since you're using #RequireAdmin, remove #RequireAdmin and try running it from Scite to see if there any errors. Edited February 21, 2017 by Subz Link to comment Share on other sites More sharing options...
Nursultan Posted February 21, 2017 Author Share Posted February 21, 2017 "C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\idocs\dll.au3" "C:\idocs\dll.au3" (15) : ==> Incorrect number of parameters in function call.: MsgBox(0, 'done') ^ ERROR >Exit code: 1 Time: 0.5025 Link to comment Share on other sites More sharing options...
Subz Posted February 21, 2017 Share Posted February 21, 2017 So your MsgBox is incorrect, it should be MsgBox(0, '', 'Done') Link to comment Share on other sites More sharing options...
Nursultan Posted February 21, 2017 Author Share Posted February 21, 2017 dlls and this script should be in same location, and can not to merge this script with other script which have RequireAdmin, am I right? Link to comment Share on other sites More sharing options...
Subz Posted February 21, 2017 Share Posted February 21, 2017 You can merge them, the only reason I said switch off #RequireAdmin is so you can see whats happening in the console ie. debugging purposes. You can re-add it again or merge your scripts with other scripts. Link to comment Share on other sites More sharing options...
Nursultan Posted February 21, 2017 Author Share Posted February 21, 2017 what about location? Link to comment Share on other sites More sharing options...
Subz Posted February 21, 2017 Share Posted February 21, 2017 If you hard code the location then you always need to use that location, however by using @ScriptDir it always points at the folder your script is in. So if you copied all your files to \\Server\Share\ the script will resolve @ScriptDir to \\Server\Share. Link to comment Share on other sites More sharing options...
Nursultan Posted February 22, 2017 Author Share Posted February 22, 2017 @Subz will dll script run in other pc? Link to comment Share on other sites More sharing options...
Nursultan Posted February 22, 2017 Author Share Posted February 22, 2017 @Subz what about dll, where should I to put dll, (the location)? Link to comment Share on other sites More sharing options...
Subz Posted February 22, 2017 Share Posted February 22, 2017 Nursultan, you need to do some investigation yourself, what I suggest is setup a VM for testing and test, you will find that the dll needs to be copied to the local machine probably into an area like C:\Program Files (x86)\Your Program and registered from there. If you want to do a complete setup package then you should probably look at InnoSetup using the QuickStart Pack its extremely simple to understand and will allow you to register the dlls, setup an uninstaller for your program etc... (AutoIt Setup uses InnoSetup for its installer) http://www.jrsoftware.org/isdl.php Link to comment Share on other sites More sharing options...
Nursultan Posted February 22, 2017 Author Share Posted February 22, 2017 @Subz I manually registered dll in C:\idocs. I put all dll in this location. If I put setup.exe (script) and dll in this location, will it work? Link to comment Share on other sites More sharing options...
Nursultan Posted March 3, 2017 Author Share Posted March 3, 2017 @Subz What should I do if soft has update version, should I change in script something? Link to comment Share on other sites More sharing options...
Subz Posted March 3, 2017 Share Posted March 3, 2017 @Nursultan Its generally very rare for switches to change for an application, so backup your current script folder, overwrite the old exe with the new exe (make sure the name of the file hasn't changed, if it has you need to update that in the script, then test the installation again. 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