In terms of getting the DLL working, this is a good guide.
http://www.codeproject.com/tips/msicustomaction.asp?df=100&forumid=3159&exp=0&select=785495

It doesn't show you how to do what you want in the DLL, but it does show you 
the steps needed to get 
one working.  As for the actual code, do you not have a programmer at the 
company you could get help 
from?

Rob

WayneBoyles wrote:
> Hello,  I hope the following makes sence to someone!
> 
> We have a piece of software which was done before I started with the company
> and now I have taken over the installation side of things.
> 
> I am reading a registry value in a property called DATABASEPATH.  This works
> fine except the original programmer set the entire path including the
> filename which i don't want, i only want the directory path (so at the
> moment we have for example: 'C:\My Folder\MyFile.txt' and what i NEED is
> 'C:\My Folder\')
> 
> I have no idea how to tackle this and I have been playing around with
> CustomActions but I really dont know what I'm doing.  I have some sample
> code from the MS Website which I modified and looks like this...
> 
> UINT __stdcall DirectoryFormatter(MSIHANDLE hInstall)
> {
>       TCHAR* szValueBuf = NULL;
>       DWORD cchValueBuf = 0;
>       UINT uiStat = MsiGetProperty(hInstall, TEXT("DATABASEPATH"), TEXT(""),
> &cchValueBuf);
>       MsiSetProperty(hInstall, TEXT("DATABASEPATH"), TEXT("C:\\"));   // set 
> the
> property
> 
>       if (ERROR_MORE_DATA == uiStat)
>       {
>               ++cchValueBuf;
>               
>               szValueBuf = new TCHAR[cchValueBuf];
>               if (szValueBuf)
>               {
>                       uiStat = MsiGetProperty(hInstall, TEXT("DATABASEPATH"), 
> szValueBuf,
> &cchValueBuf);
>                       MsiSetProperty(hInstall, TEXT("DATABASEPATH"), 
> TEXT("C:\\"));   // set the
> property
>               }
>       }
> 
>       if (ERROR_SUCCESS != uiStat)
>       {
>               if (szValueBuf != NULL)
>               {
>                       delete [] szValueBuf;
>               }
> 
>               return ERROR_INSTALL_FAILURE;
>       }
> 
>       delete [] szValueBuf;
> 
>       return ERROR_SUCCESS;
> }
> 
> Obviously a function will replace 'C:\\' with the stripped down path (could
> probably figure that out).
> 
> My problem is getting this to run and change the DATABASEPATH property.  The
> user is not going to get a choice at to where to install this because it
> will be installed into the directory that it finds.  Am I over complicating
> things?  If there is an easier way I would love to hear it because I'm
> pulling my hair out now!
> 
> I am NOT a C++ Programmer so I have no idea what that code is doing!!  Any
> help will be greatly appreciated.
> 
> Thanks in advance


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to