Version Auto-Increment not updating index.html

I enabled automatic version numbering in my PWA app in Delphi project options.

grafik

When compiling, the created js is incremented as expected, but the line in the index.html referencing the js remains unchanged, such that the app woun't be started in the browser.

In addition, when the compiler creates a new js with new version number, the old one does not get deleted from the output folder, which causes unneccessary server uploads.

grafik

Are you sure this is a clean install of the latest version v1.6.1.0?

Yes, as much as I can. I always Windows-deinstall Web Core and also delete all remaining traces before installing a new version. For testing purposes, I have also installed the VSC version in parallel, if that information is of any value.

I cannot reproduce this.
Is this happening for a new project as well?
Do you set BOTH 1) the initial version AND 2) to do automatic versioning?

I can confirm that this works Ok on a new PWA project.

Any Yes to both of your questions 1 and 2.

So, how can versioning be reenabled in my project. Or alternatively, what steps do I need to do to create a new PWA project from an existing one?

And is there any way to automatically delete any old .js-files with old version numbers from the output directory (other than doing this manually)? Or even better, to delete the whole output directory before each compile?

We are not aware of an issue with this
Can you send such problematic project so we can investigate?
There is at this moment not a setting to automatically delete files in the output folder.
We are a bit reluctant to add code that would delete files there and risk to have deleted something unwantedly for someone.

Dear Bruno,

please find attached the problematic project.

Would you mind to also respond to my issues:

  • TWebImageControl resizing image fails
  • TCustomImageControl.OnLoaded never fires
  • TWebMessageDlg - How to prevent element.styles when there are CSS classes set

The code related to the first 2 problems you will find in TMainForm.SetCustomerLogo followed by the timer (!!) called TMainForm.ImgClientLogoLoaded, where I desperately try to change the size of the image, with no luck by now.

For the TWebMessageDlg issue, please see Unit Tools.pas Function MessageDlgEx().

With regards to deleting files in the output folder, I fully understand your point. So maybe it would be a great idea if there was a way to add to the project options two settings for batchfiles that are executed before and after the compiler run. In my case, the BEFORE batch would clear the output directory and the AFTER batch would FTP the output to the server. At the moment, I do this manually…

Many thanks, kind regards / Freundliche Grüße

Walter Weyers

(Attachment PWA.7z is missing)

Ok, 2nd try, now with a ZIP instead of 7z…

(Attachment PWA.zip is missing)

C’mon, 6MB too large? Ok, here the sources w/o resources.

PWA.zip (385 KB)

Apparently you have changed your index.html file and broken it.

The normal JS reference in the project HTML file is:

$(ProjectName) gets replaced by the project name + version.

You hard coded it in your index.html to

<script type="text/javascript" src="Steuercheckliste.js"></script>

so, obviously the compiler cannot find what it should replace.

Oops, my fault, must have happend while hunting other problems.
Feature request: Compiler error message when $(ProjectName) is missing.
Sorry for wasting your time!

We will look to generate a warning.