|
#1
|
||||
|
||||
|
I have recently updated the LuaCOM plugin which works for Setup Factory 7.0 as well as AutoPlay Media Studio 5.0 and TrueUpdate 2.0.
Quote:
LuaCOM Plugin Homepage |
|
#2
|
||||
|
||||
|
Using the LoaCOM Plugin (Example)
I couldn't find any good examples of the usage of this plugin for SF7 and so after some trial and error and reading of documentation, here is what I came up with. The Code below checks to see of the SQL Server Service is installed and running and uses the SQLDMO COM Object to do this. Hope this helps someone looking for an example.
Code:
local liServerRunning = Service.Query("MSSQLSERVER","");
local llInstalledSQLServer = false;
if liServerRunning == 0 then
-- Install service or exit
local lcParameters = "SAPWD=" .. SessionVar.Expand("%SAPwd%") .. "/settings=" .. String.Char(34) .. "setup.ini" .. String.Char(34);
File.Run(SessionVar.Expand("%SourceFolder%\\MSDE\\setup.exe"), lcParameters, SessionVar.Expand("%SourceFolder%\\MSDE"), SW_SHOWNORMAL, true);
llInstalledSQLServer = true;
end
local liServerRunning = Service.Query("MSSQLSERVER","");
if liServerRunning == 1 then
-- SQL Server Service Stopped (need to restart)
Service.Start("MSSQLSERVER", "", nil);
if Application.GetLastError() > 0 then
Application.Exit(-1);
end
elseif liServerRunning ~= 4 then
Debug.Print("Error\r\n");
Debug.Print(liServerRunning);
if Dialog.Message("Error", "Please Ensure That The MSSQLSERVER Service Is Running.", MB_RETRYCANCEL, MB_ICONEXCLAMATION) == 2 then
Application.Exit(-1);
else
liServerRunning = Service.Query("MSSQLSERVER","");
if liServerRunning ~= 4 then
Application.Exit(-1);
end
end
end
sqlserver = luacom.CreateObject("SQLDMO.SQLServer");
assert(sqlserver);
sqlserver.LoginSecure = true;
sqlserver:Connect();
local llChangedAuthMode = false;
if llInstalledSQLServer then
sqlserver.IntegratedSecurity.SecurityMode = 2;
llChangedAuthMode = true;
else
local lnSecurityMode = sqlserver.IntegratedSecurity.SecurityMode;
if lnSecurityMode ~= 2 then
if Dialog.Message("Server Error", "Would you like to switch SQL Server to use Mixed Mode Authentication?", MB_YESNO, MB_ICONEXCLAMATION) == 6 then
sqlserver.IntegratedSecurity.SecurityMode = 2;
llChangedAuthMode = true;
else
Application.Exit(-1);
end
end
end
sqlserver:Close();
sqlserver = nil;
collectgarbage();
if Application.GetLastError() > 0 then
Application.Exit(-1);
end
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Spotlight: CD Audio Action Plugin | Desmond | AutoPlay Media Studio 5.0 | 16 | 05-15-2006 08:02 PM |
| Luacom Plugin | Roboblue | AutoPlay Media Studio 6.0 | 2 | 09-23-2005 02:28 PM |
| LuaCOM plugin ExitScript Error | genevangampelaere | TrueUpdate 2.0 | 2 | 04-29-2005 09:30 AM |
| Action Plugin: LuaCOM | Brett | AutoPlay Media Studio 5.0 | 19 | 01-31-2005 11:58 PM |
| Indigo Rose Plugin Changes | Lorne | AutoPlay Media Studio 5.0 | 4 | 09-27-2004 05:17 AM |
All times are GMT -6. The time now is 02:38 AM.








Linear Mode

