Simon Brown Posted January 1, 2008 Share Posted January 1, 2008 Hi, I am writing an automated installer for my Film Noir plugin. Can you please show me how to get the Paint.NET version in c# code? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted January 1, 2008 Share Posted January 1, 2008 First, you need to get the installation directory. It's at HKLM / Software / Paint.NET / TARGETDIR (btw make sure you test your installer on 64-bit, otherwise I can guarantee you'll get some things wrong ...) Next, do an Assembly.Load() on PaintDotNet.exe in that directory. Last, call GetCustomAttributes(typeof(AssemblyVersionAttribute)) on that Assembly reference. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Simon Brown Posted January 1, 2008 Author Share Posted January 1, 2008 First, you need to get the installation directory. It's at HKLM / Software / Paint.NET / TARGETDIR (btw make sure you test your installer on 64-bit, otherwise I can guarantee you'll get some things wrong ...)Next, do an Assembly.Load() on PaintDotNet.exe in that directory. Last, call GetCustomAttributes(typeof(AssemblyVersionAttribute)) on that Assembly reference. What namespace is that in? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted January 1, 2008 Share Posted January 1, 2008 Please use the MSDN documentation to answer a simple question like that. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Simon Brown Posted January 1, 2008 Author Share Posted January 1, 2008 I have tried but this code causes an error: String rootpath = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Paint.NET") .GetValue("TARGETDIR").ToString(); Assembly an = Assembly.Load(rootpath + "\\PaintDotNet.exe"); Edit: I have got it to work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.