Jump to content

Install/Uninstall Scripts


elite90

Recommended Posts

Guest louise

For firewalls its

 

netsh firewall add allowedprogram "%gameserverexe%" %serverip%_%serverport% ENABLE

netsh firewall del allowedprogram "%gameserverexe%"

 

Ports something like this

 

netsh firewall add portopening UDP %serverport% UDP-%serverport%

netsh firewall add portopening UDP %queryport% UDP-%queryport%

netsh firewall add portopening ALL %rconport% ALL-%rconport%

netsh firewall add portopening UDP %primary_customport1% UDP-%primary_customport1%

netsh firewall add portopening UDP %primary_customport2% UDP-%primary_customport2%

Link to comment
Share on other sites

For firewalls its

 

netsh firewall add allowedprogram "%gameserverexe%" %serverip%_%serverport% ENABLE

netsh firewall del allowedprogram "%gameserverexe%"

 

Ports something like this

 

netsh firewall add portopening UDP %serverport% UDP-%serverport%

netsh firewall add portopening UDP %queryport% UDP-%queryport%

netsh firewall add portopening ALL %rconport% ALL-%rconport%

netsh firewall add portopening UDP %primary_customport1% UDP-%primary_customport1%

netsh firewall add portopening UDP %primary_customport2% UDP-%primary_customport2%

 

Is this for opening the ports with windows firewall?

 

Cheers

Link to comment
Share on other sites

Guest louise

Simple put them in your Install/Uninstall Scripts and when it gets install it will auto add / or remove itsself

 

If servers are already on there you need to manually add them

Link to comment
Share on other sites

Ok, I need to automate adding existing servers. I am setting up fast download URL on 300+ servers, so manual isn't really possible. I assume that it would be possible to make a tca script that runs the commands foreach server.

 

Thanks

Link to comment
Share on other sites

Thank you to the person that gave me this. :)

 

 

Change Dim gameid As String = "TCXXXXXXXXXXXXXX" to the game ID that you want it to execute the scripts on. To execute the uninstall script, change

Dim script As String = game.InstallScript()

to

Dim script As String = game.UninstallScript()

 

 

 

<tcascript>
<language name="VB" />
<waitForUserAction value="true"/>

<scriptCode><![CDATA[

Imports System

Class ExecuteScript
   Public Shared Sub Main()
       Dim gameid As String = "TCXXXXXXXXXXXXXX"
       Dim game As New TCAdminSDK.Objects.Game
       Dim services() As TCAdminSDK.Objects.Service = TCAdminSDK.Objects.Service.GetServices()
       game.GameID = gameid
       game.Find()

       Dim script As String = game.InstallScript()

       If Not services Is Nothing Then
           For Each service As TCAdminSDK.Objects.Service In services
               Try
                   If service.GameID = gameid Then
                       Dim user As New TCAdminSDK.Objects.User(service.UserID)
                       'Load dynamic values 
                       Dim DynamicValues As TCAdminSDK.Remote.Plugins.GSAutomation.GameServerDynamicValues
                       With DynamicValues
                           .GameName = game.Name
                           .GameServerShortName = game.ShortName
                           .ServerIP = service.ServerIP
                           .ServerPort = service.ServerPort
                           .QueryPort = service.ServerQueryPort
                           .RCONPort = service.ServerRCONPort
                           .CustomPort1 = service.CustomPort1
                           .CustomPort2 = service.CustomPort2
                           .CustomPort3 = service.CustomPort3
                           .CustomPort4 = service.CustomPort4
                           .CustomPort5 = service.CustomPort5
                           .Slots = service.Slots
                           .HostName = String.Empty
                           .RCONPassword = String.Empty
                           .PrivatePassword = String.Empty
                           .IsPrivate = service.Private
                           .UserFilesPath = service.UserFilePath
                           .GameFilesPath = service.AutomationFilesPath
                           .OwnerUserID = service.UserID
                           .OwnerName = user.FullName
                           .OwnerPassword = TCAdminBase.Encryption.DecryptString128Bit(user.Password)
                           .PrimaryServiceID = service.PrimaryServiceID
                           .Application = service.Application
                           .GameKey = service.GameKey
                       End With

                       Dim servicescript As String = TCAdminSDK.Remote.Plugins.GSAutomation.ReplaceGameServerValues(script, DynamicValues)
                       Dim su As TCAdminBase.Plugins.IGenericPlugIn = TCAdminSDK.Remote.InstanceCreator.GetPluginFromServer(service.ServerID, "TCAdminMonitor.StandardPlugins.RemoteServers.ServerUtilities")
                       Dim exitcode As Integer = su.Execute(New Object() {"ExecuteScript", service.WorkingDirectory, servicescript})
                       Console.WriteLine("Executed script on {0} with exit code {1}", service.UniqueDisplayNameWithOwner, exitcode)
                   End If
               Catch ex As Exception
                   Console.WriteLine("-------------------------")
                   Console.WriteLine("Error executing script on {0}: {1}", service.UniqueDisplayNameWithOwner, ex.ToString())
                   Console.WriteLine("-------------------------")
               End Try
           Next
       End If
       Console.WriteLine("Finished.")
   End Sub
End Class

]]></scriptCode>

</tcascript>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Who's Online   0 Members, 0 Anonymous, 8 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use