Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How to use PathMakeSystemFolder API Call


2 replies to this topic

MatrixTech

MatrixTech
  • Members
  • 1 posts

Posted 28 November 2001 - 18:17

Since I am weak on using external W32 API calls, can someone show me, by example, how to create an IS function that allows me to send

PathMakeSystemFolder
and
PathUnmakeSystemFolder

MSDN Function Links:
PathMakeSystemFolder:
http://msdn.microsof...rary....Folder:
http://msdn.microsof...rary....asp<p>I have done some studying of POINTER and LPSTR, but it's a little beyond my knowledge of how to set this up.  The reason I want to do this is to set my installation folders to have the "system" attribute to utilize the "desktop.ini" file that I place there.  IS doesn't have a way (that I know of) to change folder attributes.

If someone has a better way of setting system attributes of a folder from InstallScript, I'm interested.  What I'm doing right now is using LaunchAppEx to call the console app "ATTRIB" to set my attributes.  It works, but it causes momentary jerks on the screen and I don't like this method.

Thanks in advance,


Ide Nentjes

Ide Nentjes
  • Members
  • 222 posts

Posted 29 November 2001 - 15:25

First, set attrbutes of both File and Folder with SetFileInfo()


As for Api info:

1 - translate the API parameters: LPTSTR translates as a string pointer in IS.

2- find out in which lib the  API is located, and prototype it:


prototype Shlwapi.PathUnmakeSystemFolder(POINTER );

and use it as follows

szPath="C:\\MyApp\\bin";
iReturn = PathUnmakeSystemFolder(&szPath);
if (iReturn==0) then
 // Some Error
endif;

Note the ampersant (&) which tells IS to pass the address of the string, not the string itself.

Ide


Blake Miller Wonder

Blake Miller Wonder
  • Members
  • 121 posts

Posted 29 November 2001 - 17:07

I am currently using this function in a project.
I would warn everyone that the function is only available if IE 4.0 or later is installed to the computer.
There is also a different mechanism for setting up this information for Windows XP, sorry I don't recall what it is at the moment, they talked about it in a recent MSDN magazine article.