Jump to content
Ketarin forum
SafeNet Authentication Client (SAC) (x32)
Guest
By Guest, 03/21/2018
  • 14 downloads
  • Updated:

File Details

  • Website URL
  • User Agent
  • Category Smart Card
  • User Notes

(Show)XML Contents

            <?xml version="1.0" encoding="utf-8"?>
<Jobs>
  <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="37aafdc9-47da-4372-a552-ec59c6417242">
    <WebsiteUrl/>
    <UserAgent/>
    <UserNotes/>
    <LastFileSize>7365331</LastFileSize>
    <LastFileDate>2018-02-16T09:30:54.519569</LastFileDate>
    <IgnoreFileInformation>false</IgnoreFileInformation>
    <DownloadBeta>Default</DownloadBeta>
    <DownloadDate xsi:nil="true"/>
    <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
    <VariableChangeIndicator/>
    <HashVariable/>
    <HashType>None</HashType>
    <CanBeShared>true</CanBeShared>
    <ShareApplication>true</ShareApplication>
    <ExclusiveDownload>false</ExclusiveDownload>
    <HttpReferer/>
    <SetupInstructions>
      <SetupInstruction xsi:type="CustomSetupInstruction">
        <Code>/*
  Enter a custom C# script here. C# is case sensitive.
  "app" references the current application.
  Example:
  MessageBox.Show(app.Name);
  
  = Notable methods =
  app.PreviousLocation
    Corresponds to the variable {file}

  app.Variables.ReplaceAllInString("Any {text} with variables.")
    Replaces all known variables in a given string.
    Example: string new = app.Variables.ReplaceAllInString("{file}")

  return;
    Exits the script.

  Abort("Error text\r\n");
    Exits the script with a given error.
*/
Func<List<string>, int> Exec = new Func<List<string>, int>( (list) =>
{
    string fileName, arguments, Verb;
    fileName = arguments = Verb = string.Empty;
    bool waitForExit = true;

    // Ketarin.Forms.LogDialog.Log("Exec - list.Count: " + list.Count);

    switch (list.Count)
    {
        case 1:
            fileName = list[0];
            break;
        case 2:
            fileName = list[0];
            arguments = list[1];
            break;
        case 3:
            fileName = list[0];
            arguments = list[1];
            Verb = list[2];
            break;
        case 4:
            fileName = list[0];
            arguments = list[1];
            Verb = list[2];
            waitForExit = System.Convert.ToBoolean(list[3]);
            break;
    }

    System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(fileName, arguments);
    startInfo.Verb = Verb;
    Ketarin.Forms.LogDialog.Log(fileName + " " + arguments);

    var process = System.Diagnostics.Process.Start (startInfo);
    if (waitForExit)
    {
        process.WaitForExit();
    }

    Ketarin.Forms.LogDialog.Log("process.ExitCode: " + process.ExitCode);
    return process.ExitCode;
});

using (System.IO.StreamWriter outfile = new System.IO.StreamWriter(System.IO.Path.Combine(System.IO.Path.GetTempPath(), "UnZIP.vbs")))
            {
				outfile.Write("If WScript.Arguments.Count < 2 Then:WScript.Quit(1):End If\r\n");
                outfile.Write("Dim objFSO:Set objFSO = CreateObject(\"Scripting.FilesystemObject\"):Dim objShell:Set objShell = CreateObject(\"Shell.Application\")\r\n");
                outfile.Write("Dim strFileZIP:strFileZIP = WScript.Arguments(0):Dim strOutFolder:strOutFolder = WScript.Arguments(1)\r\n");
                outfile.Write("If IsEmpty(strFileZip) Or Not objFSO.FileExists(strFileZip) Then:WScript.Quit(1):End If\r\n");
                outfile.Write("If Not objFSO.FolderExists(strOutFolder) Then:On Error Resume Next:objFSO.CreateFolder(strOutFolder):On Error Goto 0:If Err.Number <> 0 Then:WScript.Quit(Err.Number):End If:End If\r\n");
                outfile.Write("Dim objSource:Set objSource = objShell.NameSpace(strFileZip)\r\n");
                outfile.Write("Dim objTarget:Set objTarget = objShell.NameSpace(strOutFolder)\r\n");
                outfile.Write("objTarget.CopyHere objSource.Items, 4 Or 16\r\n");
				outfile.Write("Dim AEnumItems:EnumItemsAll strFileZip, AEnumItems\r\n");
				outfile.Write("For i = 0 To UBound(AEnumItems)\r\n");
				outfile.Write("\tDim sRelativeItemPath : sRelativeItemPath = Mid(AEnumItems(i)(0), Len(strFileZip)+1, Len(AEnumItems(i)(0)))\r\n");				
				outfile.Write("\tIf (AEnumItems(i)(3)) Then:Do While Not objFSO.FolderExists(objFSO.BuildPath(strOutFolder, sRelativeItemPath)):WScript.Sleep(200):Loop:Else:Do While Not objFSO.FileExists(objFSO.BuildPath(strOutFolder, sRelativeItemPath)):WScript.Sleep(200):Loop:Dim objFile : Set objFile = objFSO.GetFile(objFSO.BuildPath(strOutFolder, sRelativeItemPath)):Do While objFile.Size <> AEnumItems(i)(2):WScript.Sleep(200):Loop:End If\r\n");
				outfile.Write("Next\r\n");
				outfile.Write("\r\nFunction EnumItemsAll(strNameSpaceZIP, AItems)\r\n");
				outfile.Write("\tDim objSource, AI2, AI1(), iRet, i, UB, i2\r\n");
				outfile.Write("\tSet objSource = objShell.NameSpace(strNameSpaceZIP).Items()\r\n");
				outfile.Write("\tIf (Not objSource Is Nothing) Then\r\n");
				outfile.Write("\t\tIf objSource.Count > 0 Then\r\n");
				outfile.Write("\t\t\tReDim Preserve AI1(objSource.Count - 1)\r\n");
				outfile.Write("\t\t\tFor i = 0 to objSource.Count - 1\r\n");
	            outfile.Write("\t\t\t\tOn Error Resume Next\r\n");
	            outfile.Write("\t\t\t\tAI1(i) = Array(objSource.Item(i).Path, objSource.Item(i).Name, objSource.Item(i).Size, CBool(objSource.Item(i).IsFolder))\r\n");
				outfile.Write("\r\n\t\t\t\tIf CBool(objSource.Item(i).IsFolder) Then\r\n");
	            outfile.Write("\t\t\t\t\tiRet = EnumItemsAll(objSource.Item(i).Path, AI2)\r\n");
	            outfile.Write("\t\t\t\t\tIf (iRet > 0) Then\r\n");
	            outfile.Write("\t\t\t\t\t\tUB = UBound(AI1)\r\n");
	            outfile.Write("\t\t\t\t\t\tReDim Preserve AI1(UB + iRet)\r\n");
	            outfile.Write("\t\t\t\t\t\tFor i2 = 1 to iRet\r\n");
	            outfile.Write("\t\t\t\t\t\t\tAI1(UB + i2) = AI2(i2 - 1)\r\n");
	            outfile.Write("\t\t\t\t\t\tNext\r\n");     
	            outfile.Write("\t\t\t\t\tEnd If\r\n"); 
	            outfile.Write("\t\t\t\tEnd If\r\n");       
	            outfile.Write("\t\t\tNext\r\n");
				outfile.Write("\t\tEnd If\r\n");
				outfile.Write("\tEnd If\r\n");
				outfile.Write("\tAItems = AI1\r\n");
				outfile.Write("\tEnumItemsAll = 0\r\n");
				outfile.Write("\tEnumItemsAll = UBound(AItems) + 1\r\n");
				outfile.Write("End Function\r\n");
            }
			
string extractTo = System.IO.Path.Combine(System.IO.Path.GetTempPath(), System.IO.Path.GetRandomFileName());

List<string> ExecList = new List<string> {"cscript", "//E:VBS \"" + System.IO.Path.Combine(System.IO.Path.GetTempPath(), "UnZIP.vbs") + "\" \"" + app.PreviousLocation + "\" \"" + extractTo + "\"" };
if (Exec(ExecList) != 0)
{
    Abort("Extraction failed.");
}

foreach (string fileName in System.IO.Directory.GetFiles(extractTo, "*.msi"))
{
    ExecList = new List<string> { "msiexec", "/i \"" + System.IO.Path.Combine(extractTo, fileName) + "\" /qb /norestart", "runas" };
    int errorCode = Exec(ExecList);
    if(errorCode != 0)
    {
        Abort("Installation failed (" + errorCode + ").");
    }
}
</Code>
        <Type>CS</Type>
      </SetupInstruction>
    </SetupInstructions>
    <Variables>
      <item>
        <key>
          <string>url</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>http\S+SAC\S+\windows_x32.zip</Regex>
            <Url>https://safeweb.com.br/suporte/downloads</Url>
            <Name>url</Name>
          </UrlVariable>
        </value>
      </item>
    </Variables>
    <ExecuteCommand/>
    <ExecutePreCommand/>
    <ExecuteCommandType>Batch</ExecuteCommandType>
    <ExecutePreCommandType>Batch</ExecutePreCommandType>
    <Category>Smart Card</Category>
    <SourceType>FixedUrl</SourceType>
    <PreviousLocation/>
    <DeletePreviousFile>false</DeletePreviousFile>
    <Enabled>true</Enabled>
    <FileHippoId/>
    <LastUpdated>2018-02-16T09:30:54.519569</LastUpdated>
    <TargetPath>S:\Medicina\Contabilidade\Smart Card\SafeNet Authentication Client (SAC) - Aladdin eToken PKI\</TargetPath>
    <FixedDownloadUrl>{url}</FixedDownloadUrl>
    <Name>SafeNet Authentication Client (SAC) (x32)</Name>
  </ApplicationJob>
</Jobs>

        

Comments

There are no comments to display.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Add your comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • 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.