Author Topic: Workaround for Date formatting and (maybe) comma delimiter  (Read 1011 times)

0 Members and 1 Guest are viewing this topic.

Offline SaberSnail (OP)

  • Leading Rate
  • *
  • Posts: 7
  • Thanked: 3 times
It's considered working as intended (or not to be fixed) that your system formatting settings for Date and Decimal can cause problems with the game. 

I put together a script that changes your system settings, starts the game, then restores your settings back to what they were. 

I've tested this with the Date formatting.   I haven't tested with the Decimal, but this should work with that as well. 

I'm offering this with no guarantees.   Use at your own risk.   That said, I did my best to make sure this doesn't cause problems. 

Instructions:
  • Download the attached zip file.   Extract the contained PowerShell script file to someplace where it can live.   Example: C:\Games\AuroraTools\
  • Edit the file.   Replace the path set on the first line to the path to where the Aurora.  exe file is located.   If you want, replace the second line with your desired date format.   This page might help: https://docs.  microsoft.  com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings
  • Create a new shortcut to this script.   Then right click on the script and open the properties.   Change the target to tell PowerShell to ignore the normal check for permission to run scripts.   Example: powershell.  exe -ExecutionPolicy ByPass -File C:\Games\AuroraTools\StartAurora.  ps1

If this doesn't seem to be having an effect, try increasing the value on the fifth line (delayBeforeExitInSeconds).   This will force the script to wait a little longer after the application starts before setting the system settings back to their old values. 

This script works by changing the system settings in the registry and then starting the game.   At some point early on, the application gets its formatting settings from the system.   After this, the system settings can be restored and the script can exit.   The game will continue using the modified settings it initially got from the system, even though the original settings have been restored. 

Please let me know if you run into any problems. 
« Last Edit: May 04, 2020, 05:57:47 PM by SaberSnail »
 
The following users thanked this post: Larsaal, DeMatt, Foxxonius Augustus

Offline Larsaal

  • Able Ordinary Rate
  • L
  • Posts: 4
Re: Workaround for Date formatting and (maybe) comma delimiter
« Reply #1 on: May 04, 2020, 10:13:01 AM »
Works fine!
Thanks makes it quiet a bit more comfortable.
 

Offline Second Foundationer

  • Warrant Officer, Class 1
  • *****
  • Posts: 85
  • Thanked: 31 times
Re: Workaround for Date formatting and (maybe) comma delimiter
« Reply #2 on: May 05, 2020, 07:11:18 AM »
(I haven't tested yet, I'll have a look at it later/one of these days when I have a quiet moment to play around with system settings and set them to various stuff Aurora can't digest by design. But if – no doubts implied, only prudence – this indeed works smoothly to solve date format problems and bridge the decimal separation channel:)

Suggestion: Could/should this be put into the installation folder and/or stickied? Possibly with a placative change in title such as "Aurora startup tool for users who write 3.14 as 3,14 or see dates cut off" or something to that effect, so that new users, especially those who initially aren't even aware of the restrictions (I find it a challenge to find Aurora and miss them, but it may happen.) don't have to experience problems in the first place, don't have to bother with system settings they may not be familiar with, and don't have to deal with or report issues that aren't really.

Secondary suggestion: Eventually, if someone with experience, confidence and a helpful spirit creates one, the script could be included in a launcher/database backup package for Aurora, where dates and desperators go under the hood and out of the way as far as possible.

In any case, thank you very much for working on a carefree script solution for date- or comma-impaired continentals (or wherever we use insane/sane – all a matter of perspective – date & number formats).

copy-edited

PS, 2020/05/06: Tested it briefly, for three configurations of Aurora-indigestible decimal separators and digit-grouping symbols, including one mildly customized date format. Seems to work smoothly for starting up Aurora with the right settings and restore previous settings properly. For anyone who has to switch date or number format twice for running Aurora once (presumably most affected by comma-kaputness in terms of numbers: French, Spanish, German, Italian users): this script may be the shortest shortcut you may find, apart from the also viable separate user method described by Omnivore in http://aurora2.pentarch.org/index.php?topic=11139.msg128952#msg128952.

One thing I cannot tell due to insufficient technical knowledge on several fronts: Is the save process absolutely "comma-safe"? Because that would happen with original settings restored. But maybe you or someone who has used the script for a while can answer that.
« Last Edit: May 06, 2020, 03:04:22 PM by Second Foundationer »
 

Offline vorpal+5

  • Commander
  • *********
  • Posts: 366
  • Thanked: 54 times
Re: Workaround for Date formatting and (maybe) comma delimiter
« Reply #3 on: May 08, 2020, 11:45:00 AM »
Is PowerShell installed with Windows?
 

Offline SaberSnail (OP)

  • Leading Rate
  • *
  • Posts: 7
  • Thanked: 3 times
Re: Workaround for Date formatting and (maybe) comma delimiter
« Reply #4 on: May 08, 2020, 05:10:26 PM »
Quote from: vorpal+5 link=topic=11237. msg131862#msg131862 date=1588956300
Is PowerShell installed with Windows?

According to Microsoft's website, "Windows PowerShell comes installed by default in every Windows, starting with Windows 7 SP1 and Windows Server 2008 R2 SP1. "

https://docs. microsoft. com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-7
 

Offline vorpal+5

  • Commander
  • *********
  • Posts: 366
  • Thanked: 54 times
Re: Workaround for Date formatting and (maybe) comma delimiter
« Reply #5 on: May 09, 2020, 03:40:15 AM »
mmmh, so it should in theory not be opened as a text file I double click on it but executed? (Windows 10)
 

Offline SaberSnail (OP)

  • Leading Rate
  • *
  • Posts: 7
  • Thanked: 3 times
Re: Workaround for Date formatting and (maybe) comma delimiter
« Reply #6 on: May 09, 2020, 07:40:57 AM »
Quote from: vorpal+5 link=topic=11237. msg132001#msg132001 date=1589013615
mmmh, so it should in theory not be opened as a text file I double click on it but executed? (Windows 10)

It doesn't execute when I double click it on my system, so that's probably normal.  Instructions for how I run it are in the original post.  You actually run powershell and pass the script as an argument.
 

Offline DeMatt

  • Petty Officer
  • **
  • D
  • Posts: 24
  • Thanked: 8 times
Re: Workaround for Date formatting and (maybe) comma delimiter
« Reply #7 on: May 13, 2020, 12:39:08 AM »
It's worth noting that, as written, this script requires PowerShell version 5.0 or greater (which, apparently, is when "Get-ItemPropertyValue" was added).  This is a newer version than that included with Windows 7 or 8.

I've attached a modified script that runs on PowerShell 2.0 (and presumably better), for those of us who refuse to upgrade.
 
The following users thanked this post: SaberSnail

 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72