- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: When displaying dialog SdAskDestPath, the directory path is incorrect.
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
When run my Setup.rul file opens the SdAskDestPath dialog box with a default path showng next to the Browse button. So how do I get that directory path to default to the directory from which I am running the installation from? In other words where my Setup.exe is being run from? This was working when I would build my release from the menu option "Build | Build Release 1". However now if I build the release through the Release wizard, and then run the installation executable, the default path shown for SdAskDestPath dialog is some long path in the "C:\Users\..." directory. I need it to default to the directory from which my released setup.exe is being executed from. Below is my current code which is using SRCDIR.
Dlg_SdAskDestPath:
szTitle = "Command File Path";
szDir =SRCDIR;
szgMessage="Please select the directory :";
nResult= SdAskDestPath(szTitle,szMsg,szDir,0);
When displaying dialog SdAskDestPath,
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @ralphster ,
If you are using installscript MSI, then you can get the path from SETUPEXEDIR property as below:
nBufferSize = MAX_PATH;
MsiGetProperty(ISMSI_HANDLE, "SETUPEXEDIR", strTest, nBufferSize);
or if it is an Installscript project you can get from the PACKAGE_LOCATION
strTest = PACKAGE_LOCATION;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @ralphster ,
If you are using installscript MSI, then you can get the path from SETUPEXEDIR property as below:
nBufferSize = MAX_PATH;
MsiGetProperty(ISMSI_HANDLE, "SETUPEXEDIR", strTest, nBufferSize);
or if it is an Installscript project you can get from the PACKAGE_LOCATION
strTest = PACKAGE_LOCATION;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi Banna,
Can you please help me some more? I am using an InstallScript Project. Will PACKAGE_LOCATION work with an InstallScript project?
I tried using PACKAGE_LOCATION and the value just comes back as an empty string.
string dirPath;
dirPath=PACKAGE_LOCATION ; // comes back as an empty string
I also tried:
ParsePath(dirPath,PACKAGE_LOCATION,FILENAME) // Still comes back with an empty string
I also tried displaying the path with a message box, but it is still empty.
MessageBoxEx("The location is : ",dirPatch,MB_OK);
Finally I tried using MsiGetProperty but get a compiler message of undefined identifier MsiGetProperty.
I also have the appropriate header #include "ifx.h", but still it does not recognize MsiGetProperty command.
MsiGetProperty(ISMSI_HANDLE,"SETUPEXEDIR",strTest,nBufferSize);
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hello @ralphster ,
have you solved your problem ?
Just asking, because you can use the windows api (GetModuleFileNameEx and/or GetCommandLine) to get the paths you want.
Let me know if you need further assistance.
regards
Markus
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi Markus,
Yes I had marked Bannah's reply as the solution. Thanks for your advice as well.
Ralp
