Community


All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Configurable silent installer
PostPosted: Tue Sep 22, 2009 11:12 am 
Offline

Joined: Mon Sep 21, 2009 5:43 am
Posts: 14
I'd like to deploy client parts of NR in silent (unattended) mode with some settings like:
Code:
NeoRouter-sup.er.fre.sh-Setup.exe /silent /login "blabla_user" /pass "blabla_pass" /domen "blabla_domen" /autosilentupdates "Yes" /addon "addon1" /addon "addon2" /addon "addonLast" /moreSetting ...


And later add/remove addons from cmd too.


Top
 Profile  
 
 Post subject: Re: Configurable silent installer
PostPosted: Tue Sep 22, 2009 10:48 pm 
Offline

Joined: Mon Dec 22, 2008 10:19 pm
Posts: 436
Thanks again for the suggestions.

Building a completely silent installer can be a little challenging because Windows always ask user's permission before installing driver.

I understand your request. We will evaluate different options and try our best to simplify the setup process for large # of clients.

_________________
Luke - NeoRouter Team


Top
 Profile  
 
 Post subject: Re: Configurable silent installer
PostPosted: Wed Sep 23, 2009 5:12 am 
Offline

Joined: Mon Sep 21, 2009 5:43 am
Posts: 14
Thanks=)
Permission for driver installing is just single press with no "using one's brains". So almost silent installer can save up to 95% time and efforts. And there's one trick for XP and 2003:
Code:
#include <windows.h>
#include <wincrypt.h>
#include <stdio.h>

#define HP_HASHVALUE HP_HASHVAL

/* This program turns the Driver signing Policy On/Off for Windows XP */
* Written by Stefan `Sec` Zehl <sec@xxxxxx>, 15.11.2004
*
* Thanks to sysinternals.com for regmon and apispy
*        to msdn.microsoft.com for windows reference
*        to cygwin for their environment
*/

void MyHandleError(char *s){
   printf("Error: %s, number %x\n.",s,(unsigned int)GetLastError());
   exit(1);
}
//--------------------------------------------------------------------
int main(void){
   HCRYPTPROV hCryptProv;
   HCRYPTHASH hHash;
   BYTE data[16];
   DWORD len;
   DWORD seed;
   HKEY hkey;
   BYTE onoff=0; // This is the On/Off toggle
   char input[4];
   int x;

   // HKLM\System\WPA\PnP\seed
   if(RegOpenKeyEx(
         HKEY_LOCAL_MACHINE,
         "System\\WPA\\PnP",
         0,
         KEY_READ,
         &hkey
         )==ERROR_SUCCESS){
      printf("RegOpenKey sucess\n");
   }else{
      printf("RegOpenKey failure\n");
   };

   len=sizeof(seed);
   if(RegQueryValueEx(
         hkey,
         "seed",
         NULL,
         NULL,
         (BYTE*)&seed,
         &len
         )==ERROR_SUCCESS){
      printf("RegQueryValue sucess\n");
   }else{
      printf("RegQueryValue failure\n");
   };

   if(hkey)
      RegCloseKey(hkey);

   printf("Seed=%x\n",(unsigned int)seed);

   printf("Hello, World\n");
   if(CryptAcquireContext(
            &hCryptProv,
            NULL,
            NULL,
            PROV_RSA_FULL,
            0))
   {
      printf("CryptAcquireContext complete. \n");
   } else {
      MyHandleError("Acquisition of context failed.");
   }
   //--------------------------------------------------------------------
   // Create a hash object.

   if(CryptCreateHash(
            hCryptProv,
            CALG_MD5,
            0,
            0,
            &hHash))
   {
      printf("An empty hash object has been created. \n");
   } else {
      MyHandleError("Error during CryptBeginHash!\n");
   }
   //--------------------------------------------------------------------
   // Compute the cryptographic hash on the data.

   input[0]=0;
   input[1]=onoff; // This is the Value!
   input[2]=0;
   input[3]=0;

   if(CryptHashData(
         hHash,
         input,
         sizeof(input),
         0))
   {
      printf("The data has been hashed. \n");
   } else {
      MyHandleError("Error during CPHashData!\n");
   }
   //--------------------------------------------------------------------

   if(CryptHashData(
         hHash,
         (BYTE*)&seed,
         sizeof(seed),
         0))
   {
      printf("The data has been hashed. \n");
   } else {
      MyHandleError("Error during CPHashData!\n");
   }
   //--------------------------------------------------------------------
   len=sizeof(data);
   if( CryptGetHashParam(
         hHash,
         HP_HASHVALUE,
         data,
         &len,
         0))
   {
      printf("The hash has been retrieved. \n");
   } else {
      MyHandleError("Error during CPGetHashParam!\n");
   }

   //--------------------------------------------------------------------
   // Clean up.

   // Destroy the hash object.

   if(hHash) {
      if(!(CryptDestroyHash(hHash)))
         MyHandleError("Error during CryptDestroyHash");
   }

   // Release the CSP.

   if(hCryptProv) {
      if(!(CryptReleaseContext(hCryptProv,0)))
         MyHandleError("Error during CryptReleaseContext");
   }

   printf("Hash: ");
   for(x=0;x<sizeof(data);x++){
      printf("%x ",data[x]);
   };
   printf("\nCreate md5 hash completed without error. \n");

   //--------------------------------------------------------------------
   // HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\PrivateHash
   if(RegOpenKeyEx(
         HKEY_LOCAL_MACHINE,
         "Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
         0,
         KEY_WRITE,
         &hkey
         )==ERROR_SUCCESS){
      printf("RegOpenKey sucess\n");
   }else{
      printf("RegOpenKey failure\n");
   };

   len=sizeof(seed);
   if(RegSetValueEx(
         hkey,
         "PrivateHash",
         0,
         REG_BINARY,
         data,
         sizeof(data)
         )==ERROR_SUCCESS){
      printf("RegSetValueEx sucess\n");
   }else{
      printf("RegSetValueEx failure\n");
   };

   if(hkey)
      RegCloseKey(hkey);
   //--------------------------------------------------------------------
   // HKLM\Software\Microsoft\Driver Signing\Policy
   if(RegOpenKeyEx(
         HKEY_CURRENT_USER,
         "Software\\Microsoft\\Driver Signing",
         0,
         KEY_WRITE,
         &hkey
         )==ERROR_SUCCESS){
      printf("RegOpenKey sucess\n");
   }else{
      printf("RegOpenKey failure\n");
   };

   len=sizeof(seed);
   if(RegSetValueEx(
         hkey,
         "Policy",
         0,
         REG_BINARY,
         &onoff,
         1
         )==ERROR_SUCCESS){
      printf("RegSetValueEx sucess\n");
   }else{
      printf("RegSetValueEx failure\n");
   };
   if(hkey)
      RegCloseKey(hkey);

   //--------------------------------------------------------------------
   // HKLM\Software\Microsoft\Driver Signing\Policy
   if(RegOpenKeyEx(
         HKEY_LOCAL_MACHINE,
         "Software\\Microsoft\\Driver Signing",
         0,
         KEY_WRITE,
         &hkey
         )==ERROR_SUCCESS){
      printf("RegOpenKey sucess\n");
   }else{
      printf("RegOpenKey failure\n");
   };

   len=sizeof(seed);
   if(RegSetValueEx(
         hkey,
         "Policy",
         0,
         REG_BINARY,
         &onoff,
         1
         )==ERROR_SUCCESS){
      printf("RegSetValueEx sucess\n");
   }else{
      printf("RegSetValueEx failure\n");
   };
   if(hkey)
      RegCloseKey(hkey);

   exit(0);
}

from here


Top
 Profile  
 
 Post subject: Re: Configurable silent installer
PostPosted: Wed Sep 23, 2009 7:37 am 
Offline

Joined: Mon Sep 21, 2009 5:43 am
Posts: 14
Here I put compiled utility for driver signing policy OFF. It have been tested by me on WindowsXP 32-bit: after launching it I've install NR just pressing "next next next finish" without any popups about "bad driver" ;)


Top
 Profile  
 
 Post subject: Re: Configurable silent installer
PostPosted: Wed Sep 23, 2009 2:32 pm 
Offline

Joined: Sun Nov 16, 2008 6:41 am
Posts: 1878
Cool! Thanks neokolyan! :lol:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron