Hi,

Has anyone had any success in running the Windows Installer (Msiexec) from the 
CreateProcessAsUser() function from Dave Roth's Win32::AdminMisc module? 
I'm following the examples provided in Dave's book.


Case 1:

I get various errors when calling from a command file (test_install.cmd):

msiexec.exe /qn /l* c:\install_log.txt /i 
\\slkclab2\lab_clients\test\app\test_app.msi INSTALLDIR="C:\Program 
Files\test\test_app" SETUPTYPE="Client" SYSREFNUM="12345" SERVERNAME="SLKCLAB2" 
SHARENAME="TEST_SHARE" READONLY="TRUE"

#SNIP#
my $command = "cmd /c \\\\slkclab2\\lab_clients\\test\\app\\test_install.cmd";

$Result = Win32::AdminMisc::LogonAsUser( $Node,
                                         $User,
                                         $Password,
                                         LOGON32_LOGON_INTERACTIVE );

if( $Result )
{
    $LogonUser = Win32::AdminMisc::GetLogonName();
    print LOG "Successfully logged on as $LogonUser.\n";
}
else
{
    print LOG "Failed to logon.\n\tError: ", Error(), "\n";
    exit;
}

    $Result = Win32::AdminMisc::CreateProcessAsUser(
                                                      $command,
                                                      "Flags", DETACHED_PROCESS,
                                                      "XSize", 640,
                                                      "YSize", 400,
                                                      "X", 200,
                                                      "Y", 175,
                                                      "XBuffer", 80,
                                                      "YBuffer", 175,
                                                      "Show", SW_MINIMIZE,
                                                      "Title", "$User's 
process",
                                                      "inherit", 1,
                                                      "Fill", BACKGROUND_BLUE |
                                                      FOREGROUND_RED |
                                                      FOREGROUND_BLUE |
                                                      FOREGROUND_INTENSITY |
                                                      FOREGROUND_GREEN,
                                                      );
#ENDSNIP#

This is from the install log:

WriteRegistryValues: Key: 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VBA\VBE\6.0\Addins\ArmVbaItems.Connect, 
Name: Description, Value: Report Manager 2002 Items for Visual Basic for 
Applications
WriteRegistryValues: Key: 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VBA\VBE\6.0\Addins\ArmVbaItems.Connect, 
Name: CommandLineSafe, Value: #0
WriteRegistryValues: Key: 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VBA\VBE\6.0\Addins\ArmVbaItems.Connect, 
Name: LoadBehavior, Value: #0
WriteRegistryValues: Key: HKEY_LOCAL_MACHINE\SOFTWARE\Blaise Software Services, 
Name: , Value: 
WriteRegistryValues: Key: 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\Atlas,
 Name: EventMessageFile, Value: C:\Program Files\Thermo\Atlas\LSShared.dll
Error 1406.Could not write value EventMessageFile to key 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\Atlas.
  System error .  Verify that you have sufficient access to that key, or 
contact your support personnel.
MSI (s) (3C:C8): Product: Atlas -- Error 1406.Could not write value 
EventMessageFile to key 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\Atlas.
  System error .  Verify that you have sufficient access to that key, or 
contact your support personnel.

There are many successful registry writes but the last one errors (1406) with 
insufficient permissions! It works fine when I run the command file directly 
from the same priviledged account ($user) but fails when run from a Perlapp exe.

Case 2:

When I change the perl script to call msiexec directly:

#SNIP#
my $command = 'msiexec.exe /qn /l* c:\install_log.txt /i 
\\slkclab2\lab_clients\test\app\test_app.msi INSTALLDIR="C:\Program 
Files\test\test_app" SETUPTYPE="Client" SYSREFNUM="12345" SERVERNAME="SLKCLAB2" 
SHARENAME="TEST_SHARE" READONLY="TRUE"'

#ENDSNIP#

I get a different error: in the install log:
 
Action ended 10:32:55: UpdateCustomizeValue. Return value 1.
Action start 10:32:55: InstallFinalize.
DEBUG: Error 2103:  Could not resolve path for shell folder 26.
Internal Error 2103. 26
MSI (s) (74:E4): Product: Atlas -- Internal Error 2103. 26

Action ended 10:32:55: InstallFinalize. Return value 3.
Action 10:32:55: . 
Action ended 10:32:55: INSTALL. Return value 3.


Any ideas what I'm doing wrong?

Thanks,
Al Lewis




_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to