KraigK
Posts: 8
Joined: Mon Jan 29, 2024 4:07 pm

Installer not picking up changes in csproj file

In my csproj file, I set the <Version> and <FileVersion> tags and then use this in my app to do a verification that the user is using the correct version of the app. I used to use a VS Setup project but recently switched to AI.

When I do a release build, I update those tags and build. When installing the resulting msi and launch the app, those updated values are not reflected. I may have gotten it to work maybe once but it is very inconsistent. It seems like whatever value was in there after the first build, is what gets 'stuck'.

I created a test app. Didn't have those tags at all in csproj, built installer, installed. Form header shows Package: 1.0.0 Build 1.0.0.0

I added the tags and changed their values. Uninstalled previous, built, installed, form header stays the same.

If I do a publish and launch that exe, the header is updated.

Will send zip via email
Last edited by KraigK on Tue Mar 19, 2024 5:53 pm, edited 1 time in total.
KraigK
Posts: 8
Joined: Mon Jan 29, 2024 4:07 pm

Re: Installer not picking up changes in csproj file

Can't send zips and forum wouldn't let me attach. Looks like I should be able to email it, I'm looking into it.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Installer not picking up changes in csproj file

Hello,

In order to send the resources, please ZIP them and upload them on e.g. DropBox and forward me the download link at support at advancedinstaller dot com so I can further test and investigate this.

Additionally, please forward me a test-case as well, as that would greatly ease the testing process.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
KraigK
Posts: 8
Joined: Mon Jan 29, 2024 4:07 pm

Re: Installer not picking up changes in csproj file

I did send a test project as zip via email, did you not receive?
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Installer not picking up changes in csproj file

Hello Kraig,

Apologies, it looks like I somehow overlooked your email.

In order for me to further test and investigate this, please forward me a test-case as well.

Looking forward to hearing from you!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
KraigK
Posts: 8
Joined: Mon Jan 29, 2024 4:07 pm

Re: Installer not picking up changes in csproj file

Open the solution I sent, enter something for the <Version> and <FileVersion> tags in .csproj Run the app in debug mode and the version numbers you entered will be in the form's title bar. Now build an installer, install, run - the forms title bar does not reflect csproj
Catalin wrote: Wed Mar 13, 2024 3:44 pm Hello Kraig,

Apologies, it looks like I somehow overlooked your email.

In order for me to further test and investigate this, please forward me a test-case as well.

Looking forward to hearing from you!

Best regards,
Catalin
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Installer not picking up changes in csproj file

Hello Kraig,

I apologize for the delayed reply.

I've tested this scenario as per your instructions and everything seemed to be working fine on my end:
Screenshot_127.png
Screenshot_127.png (271.01 KiB) Viewed 15945 times

Here's what I did:

- built the VS project first

- buit the AI project after

- took the MSI and copied it on my VM

- ran the MSI and then ran the app from the installation folder

As you can see in the above screenshot, both <Version> and <FileVersion> are reflected in the title bar of the app.

Am I missing something here?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
KraigK
Posts: 8
Joined: Mon Jan 29, 2024 4:07 pm

Re: Installer not picking up changes in csproj file

It only works the first time. Change the <FileVersion> tag, build msi and install. The new number you entered there is not reflected.

I discovered this by doing an in-place upgrade. I incremented the <Version> and <FileVersion> tags here and in the aip project. The app does replace the previous version but the Build: holds on to the old number.
KraigK
Posts: 8
Joined: Mon Jan 29, 2024 4:07 pm

Re: Installer not picking up changes in csproj file

More info:

I did a very methodical test and this seems to be an issue with AI, or the way I have my setup project configured.

Using the test app I sent. Setup as follows:

In csproj, set <Version> to 1.0.0
In csproj, set <FileVersion> to 2024.03.01.0000
Setup DefaultBuild to build InstallerTest first, then the setup project.
Build solution

Now change <Version> to 1.0.1 and <FileVersion> to 2024.03.01.1000
Build solution

Search the InstallerTest project directory for any files containing:
2024.03.01.0000 or 2024.03.01.1000

I get hits for both.

Delete the bin and obj folders. Search again and you should only get one hit for 2024.03.01.1000 in the csproj file, as it should be.

Configure the Release build to only build InstallerTest.
Build solution.
Search and you'll only get hits for 2024.03.01.1000

Switch to DefaultBuild
Build solution.
Search and you will again get hits for 2024.03.01.0000 AND 2024.03.01.1000

I also just noticed when I open the setup project in AI desktop, the 'old' version is what is shown:
aiversion.PNG
aiversion.PNG (20.87 KiB) Viewed 14944 times
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Installer not picking up changes in csproj file

Hello Kraig,

Thank you very much for your followup on this and for sharing the details with me.

It looks like I was indeed missled by the fact that it worked on the first try, which led me to not try a second time.

I've tested this again and can confirm the behavior.

I have forwarded it to our dev team for further investigations.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”