Jump to content











Photo
- - - - -

Potential .Net 4.7.1 Workaround


  • Please log in to reply
7 replies to this topic

#1 erwan.l

erwan.l

    Gold Member

  • Developer
  • 2249 posts
  • Location:Nantes - France
  •  
    France

Posted 4 weeks ago

It is slightly off topic but I could not post it in PEBakery topic (it is locked).

 

PEBakery normally requires .Net 4.7.1.

This is rather a recent version and you cant always install the latest framework (for whatever reasons - in my case, I am using my work laptop right now).

 

Creating a pebakery.exe.config with the below text will allow you to use what ever 4.x version you have on your system.

This a rather known/documented trick in the .Net world.

Several "supportedruntime" items can be added.

The software will also use the latest version.

 

I havent tried with earlier .Net versions.

All depends if PEBakary uses classes/methods found only in  latest frameworks.

Note that it could also lead to crashes/inconsistent reasons for the above reason.

 

Provided that the developper is OK, this would ensure greater compatibility with various systems outthere.

This is one of the main issues when distributing .Net apps : missing/wrong .Net framework...

 

Still, I thought I would share...

 

More details here.

<configuration>
   <startup>
      <supportedRuntime version="v4.0"/>
   </startup>
</configuration>

  • alacran likes this

#2 omniplex

omniplex

    Newbie

  • Members
  • 12 posts
  •  
    Germany

Posted 4 weeks ago

Yes, "for whatever reasons" is a good description, actually KB 4033342 in January failed on my box as normal update, therefore I disabled it, it failed as catalog update, therefore I tried https://support.micr...ol-is-available, and after the repair KB 4033342 still failed. Later in January they offered an optional 2018-01 Preview of Quality Rollup for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 on Windows 7 and Server 2008 R2 for x64 (KB4057270), that worked for me, so now I have the latest and greatest 4.5.2.

 

Then I tested something else, had to reset the system to its last known good state before KB4057270, and tried to install KB4057270 again manually from the update catalog: The 4.5.2 part worked again, the 4.7.1 part claimed to be n/a, because I have no 4.7.* or 4.6.* Just for fun I tried to install the "highly compatible" 4.7.* (failed) and 4.6.* (failed). No idea, why this always fails, maybe killing a running EMET does not work as it should.  :unsure:



#3 ied206

ied206

    Newbie

  • .script developer
  • 10 posts
  •  
    South Korea

Posted 4 weeks ago

It is slightly off topic but I could not post it in PEBakery topic (it is locked).

That is why this section board exists, to hear opinions!

 

Provided that the developper is OK, this would ensure greater compatibility with various systems outthere.

This is one of the main issues when distributing .Net apps : missing/wrong .Net framework...

 

Still, I thought I would share...

 

More details here.

<configuration>
   <startup>
      <supportedRuntime version="v4.0"/>
   </startup>
</configuration>

I didn't know about this trick, thanks for informing me.

 

In theory, PEBakery can work at least in 4.6, because it depends on Registry.CreateSubKey API which was introduced in .Net Framework 4.6.

It targeted initially 4.6.2 for proper HiDPI (per monitor dpi) support, but I faced nasty issue with .Net Standard 2.0 so I had to upgrade to 4.7.1.



#4 erwan.l

erwan.l

    Gold Member

  • Developer
  • 2249 posts
  • Location:Nantes - France
  •  
    France

Posted 4 weeks ago

Actually CreateSubKey seems to be supported starting with 4.5 (as indicated on the MS site).

And with a few lines extra of code, you can probably achieve the same while enabling a wider set of frameworks.

 

Now, my 2 cents worth of advice from an old dev guy : the more you can support previous .Net frameworks, the more you extend your user base.

Set the minimum bar and support everything above like "requires .Net 4.0 and up"?

 

  • 3.5 is very present out there (and is the last one to support CLR2.0) as it was shipped by default with Windows 7.
  • 4.0 is also very present out there (and is the first one to support CLR4.0) hence an interesting minimum requirement.
  • Anything above 4.6 included can only be installed on win10 so asking 4.7.1 would not only require latest framework but also latest windows which will considerably reduce your user base.

Delivering a proper exe.config file with PEBakery would cover a few of the challenges above.



#5 paraglider

paraglider

    Gold Member

  • .script developer
  • 1718 posts
  • Location:NC,USA
  •  
    United States

Posted 4 weeks ago

Not according to this page:

 

https://www.microsof...s.aspx?id=56116



#6 misty

misty

    Silver Member

  • Developer
  • 869 posts
  •  
    United Kingdom

Posted 4 weeks ago

...Anything above 4.6 included can only be installed on win10 so asking 4.7.1 would not only require latest framework but also latest windows which will considerably reduce your user base...


Not according to this page:

https://www.microsof...s.aspx?id=56116


I can confirm that .NET 4.7.1 installed without any issues on my Windows 7 (SP1) and Windows 8.1 systems and PEBakery is running fine on both of them.

Having said that, I am fully in agreement with Erwan.l about reducing the .NET requirement - but only at this stage if it can be done without complications and too much work.

:cheers:

Misty

#7 Atari800XL

Atari800XL

    Frequent Member

  • Advanced user
  • 109 posts
  •  
    Netherlands

Posted 4 weeks ago

How is this workaround supposed to work, exactly? I haven't managed to get it working yet...

#8 erwan.l

erwan.l

    Gold Member

  • Developer
  • 2249 posts
  • Location:Nantes - France
  •  
    France

Posted 4 weeks ago

Not according to this page:

 

https://www.microsof...s.aspx?id=56116

 

My bad, thanks for double checking this !






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users