When processing the reg section we need to delete before adding.
First pass implementation of UpdateIni.

diff --git a/dlls/setupapi/install.c b/dlls/setupapi/install.c
index e3f8adf..15c13fb 100644
--- a/dlls/setupapi/install.c
+++ b/dlls/setupapi/install.c
@@ -416,7 +416,50 @@
 
 static BOOL update_ini_callback( HINF hinf, PCWSTR field, void *arg )
 {
-    FIXME( "should update ini %s\n", debugstr_w(field) );
+    INFCONTEXT context;
+
+    BOOL ok = SetupFindFirstLineW( hinf, field, NULL, &context );
+
+    for (; ok; ok = SetupFindNextLine( &context, &context ))
+    {
+        WCHAR buffer[MAX_INF_STRING_LENGTH];
+        WCHAR  filename[MAX_INF_STRING_LENGTH];
+        WCHAR  section[MAX_INF_STRING_LENGTH];
+        WCHAR  entry[MAX_INF_STRING_LENGTH];
+        WCHAR  string[MAX_INF_STRING_LENGTH];
+        LPWSTR divider;
+
+        if (!SetupGetStringFieldW( &context, 1, filename,
+                                   sizeof(filename)/sizeof(WCHAR), NULL ))
+            continue;
+
+        if (!SetupGetStringFieldW( &context, 2, section,
+                                   sizeof(section)/sizeof(WCHAR), NULL ))
+            continue;
+
+        if (!SetupGetStringFieldW( &context, 4, buffer,
+                                   sizeof(buffer)/sizeof(WCHAR), NULL ))
+            continue;
+
+        divider = strchrW(buffer,'=');
+        if (divider)
+        {
+            *divider = 0;
+            strcpyW(entry,buffer);
+            divider++;
+            strcpyW(string,divider);
+        }
+        else
+        {
+            strcpyW(entry,buffer);
+            string[0]=0;
+        }
+
+        TRACE("Writing %s = %s in %s of file %s\n",debugstr_w(entry),
+               debugstr_w(string),debugstr_w(section),debugstr_w(filename));
+        WritePrivateProfileStringW(section,entry,string,filename);
+
+    }
     return TRUE;
 }
 
@@ -610,12 +653,12 @@
         struct registry_callback_info info;
 
         info.default_root = key_root;
-        info.delete = FALSE;
-        if (!iterate_section_fields( hinf, section, AddReg, registry_callback, &info ))
-            return FALSE;
         info.delete = TRUE;
         if (!iterate_section_fields( hinf, section, DelReg, registry_callback, &info ))
             return FALSE;
+        info.delete = FALSE;
+        if (!iterate_section_fields( hinf, section, AddReg, registry_callback, &info ))
+            return FALSE;
     }
     if (flags & (SPINST_BITREG|SPINST_REGSVR|SPINST_UNREGSVR|SPINST_PROFILEITEMS|SPINST_COPYINF))
         FIXME( "unsupported flags %x\n", flags );