Indigo Rose Software
  #1  
Old 01-31-2005
Brett's Avatar
Brett Brett is offline
Indigo Rose Staff Member
 
Join Date: Jan 2000
Posts: 2,001
Arrow Plugin: LuaCOM

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 is an add-on library to the Lua language that allows Lua programs to use and implement objects that follow Microsoft's Component Object Model (COM) specification and use the ActiveX technology for property access and method calls.
Basically, LuaCOM allows you to access COM (a.k.a. ActiveX objects) objects from your projects. It also allows you to expose COM interfaces from your applications. This means that you can do things like creating and manipulating Microsoft Word documents and many other programs and technologies that expose COM interfaces.

LuaCOM Plugin Homepage
Reply With Quote
  #2  
Old 08-04-2005
aniketb78's Avatar
aniketb78 aniketb78 is offline
Forum Member
 
Join Date: Jul 2005
Posts: 3
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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software