Hotfix Application

Belias
Member Posts: 2,998
Hi everyone,
during these weeks i have had to deal with some NAV R2 hotfixes, and i suddendly understood that it's very difficult to keep your version updated to the latest hotfix, because new hotfixes are released on a weekly basis (more or less).
Moreover, it's a pain to install them, because you extract the hofix from the zip file, and it contains 6 subfolders that contains the files to replace. You then have to "map" the hotfix folders with the installation folders (because they don't have the same name) and then copy the files from the hotfix to the client. (It's too odd to be true, am i missing something?)
I'd really like to semi automate this with a winform: ideally, i would like to ask the user to insert nav installation folder and the source folder of the hotfix. After that, click a button to do:
1. create a backup copy of the current files.
2. overwrite the files with the new version, automatically.
I am able to to this in nav, but it's not the correct way in my opinion. Ideally it would be (as i said) a winform, but unfortunately i don't have the knowledge to do it.
Any idea, please?
Thanks in advance
during these weeks i have had to deal with some NAV R2 hotfixes, and i suddendly understood that it's very difficult to keep your version updated to the latest hotfix, because new hotfixes are released on a weekly basis (more or less).
Moreover, it's a pain to install them, because you extract the hofix from the zip file, and it contains 6 subfolders that contains the files to replace. You then have to "map" the hotfix folders with the installation folders (because they don't have the same name) and then copy the files from the hotfix to the client. (It's too odd to be true, am i missing something?)
I'd really like to semi automate this with a winform: ideally, i would like to ask the user to insert nav installation folder and the source folder of the hotfix. After that, click a button to do:
1. create a backup copy of the current files.
2. overwrite the files with the new version, automatically.
I am able to to this in nav, but it's not the correct way in my opinion. Ideally it would be (as i said) a winform, but unfortunately i don't have the knowledge to do it.
Any idea, please?
Thanks in advance
0
Comments
-
I think it is not so hard. Creating winform app in Visual Studio is easy... just try it, you will learn new things. If you need more help, just ask me, I will try to help you.0
-
kine wrote:I think it is not so hard. Creating winform app in Visual Studio is easy... just try it, you will learn new things. If you need more help, just ask me, I will try to help you.
anyway, if you say so, i'll try to do it (i just have visual C# express, i hope it's enough)
0 -
Hey Belias,
That sounds like a great tool. If you ever want, I can share my knowledge from my recent level of stumbling around in C# express. Kine's right, it's pretty easy to handle making an app like that.
Shoot me a PM and we can swap contact info.JEREMY VYSKA
CEO, Spare Brained Ideas, Göteborg, Sweden
New (April 2021) Getting Started with Microsoft Dynamics 365 Business Central Book Available: "Your First 20 Hours with Business Central"0 -
I'm working on it, but tomorrow i've got a pair of exams (DEV1&2) and i've had to spend some free time on the manuals.
Anyway, I've made a raw project: it works, but it's reaaaaaaally ugly to see! (i'm talking about the code design, the UI is minimal)using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button2_Click(object sender, EventArgs e) { FolderBrowserDialog fdlg = new FolderBrowserDialog(); if (fdlg.ShowDialog() == DialogResult.OK) { textBox1.Text = fdlg.SelectedPath; } } private void button1_Click(object sender, EventArgs e) { FolderBrowserDialog fdlg = new FolderBrowserDialog(); if (fdlg.ShowDialog() == DialogResult.OK) { textBox2.Text = fdlg.SelectedPath; } } private void button3_Click(object sender, EventArgs e) { FolderBrowserDialog fdlg = new FolderBrowserDialog(); if (fdlg.ShowDialog() == DialogResult.OK) { textBox3.Text = fdlg.SelectedPath; } } private void button4_Click(object sender, EventArgs e) { DirectoryInfo di = new DirectoryInfo(textBox1.Text + "Application Server"); FileInfo[] rgFiles = di.GetFiles(); foreach (FileInfo fi in rgFiles) { File.Copy(textBox1.Text + "Application Server" + "\\" + fi.Name, textBox2.Text + "TODO" + "\\" + fi.Name, true); } DirectoryInfo di2 = new DirectoryInfo(textBox1.Text + "Application Server"); FileInfo[] rgFiles2 = di2.GetFiles(); foreach (FileInfo fi in rgFiles2) { File.Copy(textBox1.Text + "RTC" + "\\" + fi.Name, textBox2.Text + "RoleTailored Client" + "\\" + fi.Name, true); } } } }
It's incomplete, as you can see...i have some problems that i don't know how to solve:
1. if the service is up, it would be great to ask the user to shut it down, and eventually do it on his confirmation.
2. if there are more than one service, how do i manage them (i cannot know the name of the folder of the services)?
3. it would be great to read nav installation folder from registry entry or something
4. it would be also great to inherit the folder where i placed the exe. In this way i can put it in the hotfix folder and automatically populate the "hotfix folder" field
5. another great feature is to pass the paths as parameters. Something like: navhofixer /hffolder [foldername] /navfolder [foldername] /bkupfolder [foldername]0 -
ad all around services, look into my NST Admin objects for NAV. I am using the .NET assemblies to get the services, check statuses, read their folders etc.0
-
kine wrote:ad all around services, look into my NST Admin objects for NAV. I am using the .NET assemblies to get the services, check statuses, read their folders etc.0
-
update: i'm slowly going forward with this project. i just figured out how to get dynamics nav services names (and eventually stop them)
ServiceController[] services = ServiceController.GetServices(); // try to find service name foreach (ServiceController myservice in services) { string myservicestring = myservice.ServiceName.ToUpper(); if (myservicestring.IndexOf("MICROSOFTDYNAMICSNAV") != -1) { try { myservice.Stop(); } catch { }; } }
INSPIRED BY THE KINE'S NST MANAGEMENT0 -
question: how do I get the path of the executable of the service?
EDIT: i found a way:string registryPath = @"SYSTEM\CurrentControlSet\Services\" + myservicename; RegistryKey keyHKLM = Registry.LocalMachine; RegistryKey key; key = keyHKLM.OpenSubKey(registryPath); textBox4.Text = key.GetValue("ImagePath").ToString();
0 -
hi, i have some questions before going forward:
- is there a way to distinguish between a webservice service and a nav server service? (some hardcoded character in the name, some parameter...dunno): this is needed in order to exclude the webservices services from the service list
- in order to associate a nav server with its webservice server, i can use the exe file (because it is the same). Do you know another way to, or is this the only one? (this is not a relevant question, anyway)
- is it possible to INSTALL the nav client in a folder that is COMPLETELY different from the one of its server? If yes, how can i get the path of the client? (for now, i get it by trimming the path of the exe server that i found in the registry key before)
thanks in advance for your help!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions