Getting 2203 error while doing silent installation of MSI
-
Hi i am using following code for silent installation of MSI am getting 2203 error. This is the code i am using. Not working if i pass domain Administrator username and password, it is giving error like "The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2203". Can anyone tell me how to resolve this issue. Note: It is working fine if i pass the local/Built-in administrator username and password. UAC is enabled in the PC. strTempFolderToDownload = "msiexec /a "+ MSILocaltion + " ALLUSERS=0" + " TARGETDIR=" + '"' +Installlocation+ '"' + " /qb" bLogonRet = LogonUser(strUserName, strDomainName, strPassWord, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT , &hToken); if(bLogonRet && hToken!=NULL) { BOOL benvBlock = CreateEnvironmentBlock(&lpvEnv, hToken, TRUE); if(benvBlock) { dwSize = sizeof(szUserProfile)/sizeof(WCHAR); BOOL bUsrProDir = GetUserProfileDirectory(hToken, szUserProfile, &dwSize); if(bUsrProDir) { bCreateRet = CreateProcessWithLogonW(strUserName, strDomainName, strPassWord, LOGON_WITH_PROFILE, NULL, CT2W(strTempFolderToDownload),CREATE_UNICODE_ENVIRONMENT, lpvEnv, szUserProfile, &si, &pi ); } } } As well as i tried only with following code also no luck. CreateProcessWithLogonW(strUserName, strDomainName, strPassWord, LOGON_WITH_PROFILE, NULL, CT2W(strTempFolderToDownload),CREATE_UNICODE_ENVIRONMENT, NULL, NULL, &si, &pi ); CreateProcessWithLogonW(strUserName, strDomainName, strPassWord, NULL, NULL, CT2W(strTempFolderToDownload),NULL, NULL, NULL, &si, &pi );
-
Hi i am using following code for silent installation of MSI am getting 2203 error. This is the code i am using. Not working if i pass domain Administrator username and password, it is giving error like "The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2203". Can anyone tell me how to resolve this issue. Note: It is working fine if i pass the local/Built-in administrator username and password. UAC is enabled in the PC. strTempFolderToDownload = "msiexec /a "+ MSILocaltion + " ALLUSERS=0" + " TARGETDIR=" + '"' +Installlocation+ '"' + " /qb" bLogonRet = LogonUser(strUserName, strDomainName, strPassWord, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT , &hToken); if(bLogonRet && hToken!=NULL) { BOOL benvBlock = CreateEnvironmentBlock(&lpvEnv, hToken, TRUE); if(benvBlock) { dwSize = sizeof(szUserProfile)/sizeof(WCHAR); BOOL bUsrProDir = GetUserProfileDirectory(hToken, szUserProfile, &dwSize); if(bUsrProDir) { bCreateRet = CreateProcessWithLogonW(strUserName, strDomainName, strPassWord, LOGON_WITH_PROFILE, NULL, CT2W(strTempFolderToDownload),CREATE_UNICODE_ENVIRONMENT, lpvEnv, szUserProfile, &si, &pi ); } } } As well as i tried only with following code also no luck. CreateProcessWithLogonW(strUserName, strDomainName, strPassWord, LOGON_WITH_PROFILE, NULL, CT2W(strTempFolderToDownload),CREATE_UNICODE_ENVIRONMENT, NULL, NULL, &si, &pi ); CreateProcessWithLogonW(strUserName, strDomainName, strPassWord, NULL, NULL, CT2W(strTempFolderToDownload),NULL, NULL, NULL, &si, &pi );
-
Hi i am using following code for silent installation of MSI am getting 2203 error. This is the code i am using. Not working if i pass domain Administrator username and password, it is giving error like "The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2203". Can anyone tell me how to resolve this issue. Note: It is working fine if i pass the local/Built-in administrator username and password. UAC is enabled in the PC. strTempFolderToDownload = "msiexec /a "+ MSILocaltion + " ALLUSERS=0" + " TARGETDIR=" + '"' +Installlocation+ '"' + " /qb" bLogonRet = LogonUser(strUserName, strDomainName, strPassWord, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT , &hToken); if(bLogonRet && hToken!=NULL) { BOOL benvBlock = CreateEnvironmentBlock(&lpvEnv, hToken, TRUE); if(benvBlock) { dwSize = sizeof(szUserProfile)/sizeof(WCHAR); BOOL bUsrProDir = GetUserProfileDirectory(hToken, szUserProfile, &dwSize); if(bUsrProDir) { bCreateRet = CreateProcessWithLogonW(strUserName, strDomainName, strPassWord, LOGON_WITH_PROFILE, NULL, CT2W(strTempFolderToDownload),CREATE_UNICODE_ENVIRONMENT, lpvEnv, szUserProfile, &si, &pi ); } } } As well as i tried only with following code also no luck. CreateProcessWithLogonW(strUserName, strDomainName, strPassWord, LOGON_WITH_PROFILE, NULL, CT2W(strTempFolderToDownload),CREATE_UNICODE_ENVIRONMENT, NULL, NULL, &si, &pi ); CreateProcessWithLogonW(strUserName, strDomainName, strPassWord, NULL, NULL, CT2W(strTempFolderToDownload),NULL, NULL, NULL, &si, &pi );
2203 in an administrative install usually means "access denied". Where are you installing it to and is the account running the MSIEXEC command an administrator? Is the .MSI copied to the local machine before you launch it? Also, "ALLUSERS=0" isn't really a thing. The behavior of ALLUSERS isn't defined for a value of 0. The behavior is defined for values 1 and 2 and for an empty string (""). A value of 1 is for a "per-machine" install or "all users", which is typical if you're installing to Program Files. A value of 2 is for letting MSIEXEC determine which type of installation it should do, checking the value of the MSIINSTALLPERUSER property. See ALLUSERS property - Win32 apps | Microsoft Docs[^] for more.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
2203 in an administrative install usually means "access denied". Where are you installing it to and is the account running the MSIEXEC command an administrator? Is the .MSI copied to the local machine before you launch it? Also, "ALLUSERS=0" isn't really a thing. The behavior of ALLUSERS isn't defined for a value of 0. The behavior is defined for values 1 and 2 and for an empty string (""). A value of 1 is for a "per-machine" install or "all users", which is typical if you're installing to Program Files. A value of 2 is for letting MSIEXEC determine which type of installation it should do, checking the value of the MSIINSTALLPERUSER property. See ALLUSERS property - Win32 apps | Microsoft Docs[^] for more.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave KreskowiakHi Dave, Thanks for the posting. 1.) I am trying to install in C:\Program Files(x86)\ folder. 2.) I logged in as non admin user, am trying to install the MSI with domain Administrator credentials am using CreateProcessWithLogonW to do this. 3.) Yes, i copied the installer into temp location.
-
Hi Dave, Thanks for the posting. 1.) I am trying to install in C:\Program Files(x86)\ folder. 2.) I logged in as non admin user, am trying to install the MSI with domain Administrator credentials am using CreateProcessWithLogonW to do this. 3.) Yes, i copied the installer into temp location.
OK. In that case, if the command line your code generated works if an admin on the machine runs it, the problem is going to be in your code that logs in as an admin, but apparently doesn't run anything as an admin. I couldn't tell you what the problem is there.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak