Hi,

 

Your C code is fundamentally wrong. You need to get target dir from MSI db,
and check for free space only on it, for example

 

To get - set MSI property use MSI API calls, like MsiSetProperty() or
MsiGetProperty(). 

 

For example of implementing the DLL for custom actions, read through this
tutorial: http://www.codeproject.com/install/msicustomaction.asp - there you
can download sources as well. 

 

Keep wix-users list in recipients please. 

 

 

Best regards

Albert 

 

  _____  

From: Guna S [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 26, 2007 7:49 AM
To: Albert Tuulas
Subject: Re: Silent Custom Installation

 

Hi,

Please find attached a C prg to find out the disk space.

If you dont mind,Could you please modify the same into custom action(C++
DLL).

Also the you mention " , and if there's not enough of it,
change TARGETDIR or INSTALLDIR MSI variables."

Could you tell me how to do it.

with lotmany thanks,

Guna S





On 10/25/07, Albert Tuulas <[EMAIL PROTECTED]> wrote:

Rough idea is in my previous email :-)

 

  _____  

From: Guna S [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 25, 2007 7:53 AM
To: Albert Tuulas


Subject: Re: Silent Custom Installation

 

Hi,

Thanks for you reply.

If you dont mind could you give me the rough idea/code which implements
this.


thanks inadvance

Guna S

On 10/24/07, Albert Tuulas <[EMAIL PROTECTED]> wrote:

You can implement it as a custom action (C++ DLL) which checks for
reasonable amount of space on system disk, and if there's not enough of it,
change TARGETDIR or INSTALLDIR MSI variables.

-----Original Message----- 
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ]
Sent: Wednesday, October 24, 2007 8:36 AM
To: [EMAIL PROTECTED]
Subject: Re: Silent Custom Installation

Hi,

am very new to this installer.

My requirement is "If space is not available on default loc ie C drive, In
case of UI installation user can change the path. No issues. But in case of 
Silent Installation, because there is no UI, it should select another disk
which is available automatically and install there"

I want both in same file, ie user can go any way.

Can you tell me how to implement this. 

Thanks,


Albert Tuulas-3 wrote:
>
> I meant something similar to this:
>
>
>
>     <Feature Id="Feat1" Title="Feat1"
>
>       <Feature Id="Feat11" Title="Feat11" Level="1"> 
>
>           <Condition Level="1">ADDLOCAL ~= "Feat1"</Condition>
>
>       </Feature>
>
>
>
> ~= means case-insensitive comparison. Also you can check 
>
>
>
> Check that link: http://msdn2.microsoft.com/en-us/library/aa368012.aspx
> Substring Operators
>
>
>
> I've an idea that the ADDLOCAL property can be modified by a custom
> action:
>
>
>
> <CustomAction Id="CA1" Execute="immediate" Property="ADDLOCAL" 
> Value="Feat1,Feat11" />
>
>
>
> And schedule it like that:
>
>
>
> <Custom Action="CA1" Before="CostInitialize"><![CDATA[&Feat1=3]]></Custom>

>
>
>
> To make it running earlier.
>
>
>
> Although I didn't try any of these by myself, can't tell is it really
> working.
>
>
>
> Best regards 
>
> Albert
>
>
>
>   _____
>
> From: Srinivas Tirupati [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 10, 2007 2:42 PM
> To: Albert Tuulas
> Subject: RE: [WiX-users] Silent Custom Installation
>
>
>
> Hi Albert
>
>
>
> I am very new to this WIX ...
>
> I know about this Condition statement in feature tag but I didn't get how 
> we
> can use this statement for this purpose ??
>
>
>
> My purpose here  is that the person installing my product should be able
> to
> install all the child features by just specifying the parent feature name.

>
> Can you briefly explain how I can do this using condition statement in
> Feature tag ??
>
>
>
> Thanks and Regards,
>
> Srinivas T
>
>
>
> 
>
> From: Albert Tuulas [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 10, 2007 5:00 PM
> To: Srinivas Tirupati
> Subject: RE: [WiX-users] Silent Custom Installation 
>
>
>
> I got it, but there's a possibility to set <Condition> tag inside a
> feature,
> and having there attribute (Level="1") marks feature to be installed if
> condition evaluates to True.
>
>
>
> Hope it makes sense.
>
>
>
>   _____
>
> From: Srinivas Tirupati [mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
> Sent: Tuesday, July 10, 2007 2:25 PM
> To: Albert Tuulas
> Subject: RE: [WiX-users] Silent Custom Installation
>
>
>
> Level="1" for all my features
>
> 
>
> From: Albert Tuulas [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 10, 2007 4:31 PM
> To: Srinivas Tirupati; wix-users@lists.sourceforge.net
> Subject: RE: [WiX-users] Silent Custom Installation
>
>
>
> Did you try to play with <Condition Level="1">  statement inside feature
> tag? I've got no other ideas :-) 
>
>
>
>   _____
>
> From: Srinivas Tirupati [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 10, 2007 1:45 PM
> To: Albert Tuulas; wix-users@lists.sourceforge.net
> Subject: RE: [WiX-users] Silent Custom Installation
>
>
>
> Yes all features have Level="1"
>
>
>
> But i found some information from msdn which explains why it didn't
> install
> anything :-)
>
>
>
> (Source :- http://msdn2.microsoft.com/en-us/library/ms144259.aspx)
>
> ADDLOCAL Rules:
>
> *             Feature names are case sensitive.
>
> *             To use ADDLOCAL, provide a comma-delimited list with no 
> spaces
> between the features to install. For example, to install everything except
> Analysis Services and Reporting Services components, the list would be as
> follows:
>
> o
> 
ADDLOCAL=SQL_Engine,SQL_Data_Files,SQL_FullText,Notification_Services,NS_Eng
>
ine,NS_Client,SQL_DTS,Client_Components,Connectivity,SQL_Tools90,SDK,SQL_Doc
>
umentation,SQL_BooksOnline,SQL_Samples,SQL_AdventureWorksSamples,SQL_Adventu

> reWorksDWSamples,SQL_AnalysisServiceSamples,SQL_Samples
>
> *             Selecting a parent feature only installs the parent feature,
> not the parent and the child. Installing the child feature automatically 
> installs the parent and the child features. Removing the parent feature
> removes both the parent and the child feature.
>
>
>
> So do u have any other idea of how to install the all the child features 
> by
> just specifying the parent feature name ??
>
>
>
>
>
> Thanks and Regards,
>
> Srinivas T.
>
>
>
> From: Albert Tuulas [mailto: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
> Sent: Tuesday, July 10, 2007 3:58 PM
> To: Srinivas Tirupati; wix-users@lists.sourceforge.net
> Subject: RE: [WiX-users] Silent Custom Installation 
>
>
>
> A verbose log file may give more information why your feature was not
> installed. Did your features have Level="1"? Or any conditions?
>
>
>
>
> 
>   _____
>
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ] On Behalf Of Srinivas
> Tirupati
> Sent: Tuesday, July 10, 2007 9:36 AM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] Silent Custom Installation 
>
>
>
> Hi,
>
>
>
> I have a features structure like
>
>
>
> RootFeature
>
>  --- ParentFeature1
>
>         --- Feature11
>
>         --- Feature12
>
>  ---- ParentFeature2
>
>         --- Feature21
>
>         --- Feature22
>
>
>
>
>
> And I installed the product using this command ( silent installation ) 
>
> Msiexec /i  <product.msi> /qn ADDLOCAL=ParentFeature1
>
>
>
> But it did not install anything . :-(
>
>
>
> Same  case with
>
> Msiexec /i  < product.msi> /qn ADDLOCAL=ParentFeature2
>
> Msiexec /i  <product.msi> /qn ADDLOCAL=COMPLETE
>
>
>
>
>
> All the rest silent custom installations are working fine.
>
>
>
> So what might have gone wrong. Or is this by design ??
>
>
>
> Thanks and Regards
>
> Srinivas T.
>
>
>
>
>
>
>
>
>
> From: Bob Arnson [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 04, 2007 8:38 PM
> To: Srinivas Tirupati
> Cc: wix-users@lists.sourceforge.net
> Subject: Re: [WiX-users] Silent Custom Installation
>
>
>
> Srinivas Tirupati wrote:
>
> Is there any way to do custom installation in quiet mode. 
>
>
> Yes, by documenting your feature names so they can use standard MSI
> features
> like ADDLOCAL to specify a feature subset.
>
> --
> sig://boB
> http://joyofsetup.com/
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take 
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________ 
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
<https://lists.sourceforge.net/lists/listinfo/wix-users> 
>
>
Quoted from:
http://www.nabble.com/Silent-Custom-Installation-tf4022716.html#a11519399 

 

 

#include "stdafx.h"
#include<stdio.h>
#include<windows.h>
#include<winbase.h>

/*Max Disk Space required*/
#define REQ_DSKSP 50

unsigned __int64 getfreespace(LPCTSTR direct);

int _tmain(int argc, _TCHAR* argv[])
{
  unsigned __int64 space = 0;

  LPCTSTR dir[] = { L"C:\\", L"D:\\", L"E:\\",L"F:\\"  };

  int i = 0;

label:
 
  space = getfreespace( dir[i] );
 
  if ( space < REQ_DSKSP )
  {
    if ( i < 3 )
    {
      i++;
      goto label;
    }   
  }
  printf ( "Available Disk %s and Free Space %lu KB\n", dir[i],space );

  return 0;
}

unsigned __int64 getfreespace( LPCTSTR direct)
{
  unsigned __int64 freebytes;

  int GBBytes = 0;

  GetDiskFreeSpaceEx(  direct,
                          (PULARGE_INTEGER)&freebytes,         // bytes 
available to caller
                        NULL,         // bytes on disk
                        NULL );
                         
  GBBytes = freebytes/(1024L*1024L);
  return GBBytes;

}

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to