Swapan Das
4th December 2006 11:21 UTC
Detect/Modify Regional Settings Date format
Hello Friends,
I want to detect and modify Regional Settings Date format through my NSIS Installer.
Currently I'm doing it manually:
Control Panel > Regional and Language Options > Customize Regional Options >Short date format: M/d/yyyy
I hope there must be some function/routine to do it through NSIS?
With regards,
onad
4th December 2006 17:44 UTC
There is an option ofcourse with NSIS always ;)
But be aware what you want to set,
e.g. current logged in user, all users, also default settings of new users created after installer has run etc. etc.
Define it clearly for yourself first, then look at what is possible with NSIS.
Swapan Das
5th December 2006 05:19 UTC
Dear Onad,
Thanks for the response. I think I've mentioned my issue clearly. Well here it is once again:
As you know we can change the date format of the system from Control Panel > Regional and Language Options > Customize Regional Options >Short date format: M/d/yyyy
I want to detect & change this format from my NSIS installer, and avoid asking the user or the the person who is installing the software to first check the regional setting's date format and if it is something different then set it to 'M/d/yyyy' and then only proceed with the installation of MSDE and my application.
With regards,
bholliger
5th December 2006 09:35 UTC
Hi Swapan!
Have a look at the Technet. I think you'll find these information there:
http://www.microsoft.com/technet/pro...try/34667.mspx
http://www.microsoft.com/technet/pro...try/34650.mspx
Cheers
Bruno
Swapan Das
18th December 2006 07:51 UTC
Hi Everybody,
Thanks a lot Bruno for your those links. I'm sorry that I couldn't revert back with the solution in time to this thread. Well its better to be late then never.
With the help from Bruno, I've solved my issue. The following code may be helpful for those who are still green horns. The tested code:
; reading & modifying Regional Setting for Date format:
ReadRegStr $R0 HKCU \
"Control Panel\International" sShortDate
MessageBox MB_ICONEXCLAMATION|MB_OK "Your Current Date format in Regional Setting: $R0"
${If} $R0 == "M/d/yyyy"
MessageBox MB_ICONEXCLAMATION|MB_OK "Regional Setting's Date format OK"
${Else}
MessageBox MB_ICONEXCLAMATION|MB_OK "Regional Setting's Date format NOT OK"
WriteRegStr HKCU \
"Control Panel\International" "sShortDate" "M/d/yyyy"
${EndIf}