hi,
My requirement is
-> In case of Silent Install, when user give the command "msiexec /i abcdef.msi
/q"
by default it installs in C drive.
If C drive doesn't have enough space, then my installer automatically selects
another drive
which has space and should install there silently.
Following is the corresponding dll.
Here
-> for PATH am setting through custom action
-> First it checks default dir ie TARGETDIR ie "C:\"
_> If space is not avialble it will take another dir(through for loop) and
checks space there.
->Once the space is ok it setts PATh to
MsiSetProperty(hInstaller,"MYPROP",PATH);
UINT __stdcall DiskSpace(MSIHANDLE hInstaller)
{
-----
-----
rc = MsiGetProperty(hInstaller, "PATH", &PATH[0], &PATHSize);
space = findDiskSpace(PATH); /*fn that checks space and checks with
req_space and if it satisfies returns TRUE */
if(space)
{
rc = MsiSetProperty(hInstaller,"MYPROP",PATH);
if (rc != ERROR_SUCCESS)
{
::MessageBox(NULL, "MsiSetProperty(ProductId) failed.", "Error",
MB_OK);
return ERROR_INSTALL_FAILURE;
}
-----
-----
return 0;
}
Below is my wix code:
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='MyDir' Name='TestProg' LongName='Test Program'>
<Component Id='MyComponent'
Guid='12345678-1234-1234-1234-123456789012'>
<File Id='readme' Name='read.txt' LongName='readme.txt'
DiskId='1' src='C:\readme.txt' Vital='yes' />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='MyFeature' Title='My 1st Feature' Level='1'>
<ComponentRef Id='MyComponent' />
</Feature>
<InstallExecuteSequence>
<Custom Action="SetPATHValue" After="AppSearch"
>SilentInstall</Custom>
<Custom Action="DiskSp"
Before="LaunchConditions">SilentInstall</Custom>
<Custom Action='DirectorySet' Before='LaunchConditions'>NOT TARGETDIR AND
SilentInstall</Custom>
</InstallExecuteSequence>
<Binary Id="BinDiskSp" SourceFile="C:\SampleDLL.dll"></Binary>
<CustomAction Id="DiskSp" BinaryKey="BinDiskSp"
DllEntry="DiskSpace"></CustomAction>
<CustomAction Id="SetPATHValue" Property="PATH" Value="[TARGETDIR]" />
<CustomAction Id="DirectorySet" Property="TARGETDIR"
Value="[MYPROP]"></CustomAction>
<Property Id="MsiLogging">voicewarmupx</Property>
<Property Id="SilentInstall">INSTALLUILEVEL_NONE</Property>
Note: My C drive doesn't have enough space. So it will select D drive(From Dll)
When I execute msi in silent mode through it is installing in C drive only.
Any inputs where am wrong?
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users