benners Posted March 22, 2008 Share Posted March 22, 2008 I am trying to convert a js script into auto it code to implement in a program I am trying to update. The script runs OK when called from AutoIt but I need to alter some exes and command line parameters for it to work smoothly.I have tried to convert it to AutoIt with a script I found on here but there are a few errors and I know nothing about the script language. I have looked at the js script and I cannot understand it to try to convert it. Is there a program or script someone knows of that I could use or would someone be able to spare the time to have a look at it?. I know it is a lot to ask and this forum is a help not a do forum but I have tried to understand but it gives me a headache The code is below for both the js file and the convert au3 script. I have used code box because they are a bit long.Sort2Cabs.au3 Edit: Removed code - post too big and crashing the forum upgrade. Link to comment Share on other sites More sharing options...
randallc Posted March 22, 2008 Share Posted March 22, 2008 Hi, Looks like a lot of hard work and it is nowhere near done; i think you would be better re-writing it from scratch, but then you would need to know its mechanism better. I suggest you 1. read the script as a file into variable. 2. stringreplace the directories or whatever you need to change 3. write new script file and run that. Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
benners Posted March 22, 2008 Author Share Posted March 22, 2008 (edited) Hi, Looks like a lot of hard work and it is nowhere near done; i think you would be better re-writing it from scratch, but then you would need to know its mechanism better. I suggest you 1. read the script as a file into variable. 2. stringreplace the directories or whatever you need to change 3. write new script file and run that. Best, RandallThanks Randall, that's a good idea, up to yet there are two things that I will need to change 1. Update_msi_tables.exe (AutoIt), this opens orca, and presses the keys to import the tables back to the MSI files. I have since found MsiDb.Exe and this can do it silently. 2. Add the command line parameters for MsiDb.exe, so I will need to change this aRun = "Update_msi_tables.exe" to aRun = "MsiDb.Exe" but how do you add command line parameters to the script?. This is the line I think needs changing oExec = wsh.Exec(aRun) and I need to add something like this -i -dC:\Office2k3\VISPRO.MSI -fC:\Office2k3\Sort\VisPro *new*.idt would this be right?. oExec = wsh.Exec(aRun + " -i -dC:\\Office2k3\\VISPRO.MSI -fC:\\Office2k3\\Sort\\VisPro *new*.idt") Edited March 22, 2008 by benners Link to comment Share on other sites More sharing options...
ptrex Posted March 23, 2008 Share Posted March 23, 2008 @bennersMaybe this MSI Editor can help you out.regardsptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
benners Posted March 23, 2008 Author Share Posted March 23, 2008 @benners Maybe this MSI Editor can help you out. regards ptrex@ptrex Thanks I will look at the script. I ran it quickly and got an error w.r.t deleting listview items. Line 479 needs changing from _GUICtrlListView_DeleteAllItems ($listview) to _GUICtrlListView_DeleteAllItems (GUICtrlGetHandle($listview)) What the sort2cabs script does is silently recompiles files in cabs and edits the tables to reflect new and updated files, it is for a program that integrates service packs and hotfixes into an Office source then instead of having the files uncompressed it recabs them and deletes the uncompressed files, this saves space on the media. I am a bit busy with the program script but will look when I get to the point that needs the code, can your script be altered to work in a similar way to the js file or does it require a GUI?. Thanks 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