4

I created a localized wpf apllication. To install the application in the system I used msi installer provided by visual studio. Upon completion of the installation i run the application by running the commit custom action command. In the application I have written the below code to get the current UI Culture

CultureInfo ci = CultureInfo.CurrentUICulture;
string name = ci.Name;

My systems current language is in Spanish, but on installing the application via the installer it is returning to en-US culture but should remain Spanish. Once i close the application and run it again using the desktop icon it returns to the correct culture.

Can anyone help why it is returning en-US on running application using MSI.

PhilDW
  • 20,260
  • 1
  • 18
  • 28

1 Answers1

1

It's related to this:

Windows installer using the NT AUTHORITY\SYSTEM instead of login user

Custom actions run from Visual Studio setup projects run with the local system account, not with the installing user's credentials. There isn't a good solution to this (see the related link) because there's no good way to start a program from the install as if it was started from the logged on interactive user.

PhilDW
  • 20,260
  • 1
  • 18
  • 28