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

Basic Custom Install Path question - URGENT


8 replies to this topic

bbeachem

bbeachem
  • Members
  • 5 posts

Posted 14 July 2004 - 16:51

Okay, this seems straight forward in the documentation, tutorial, and online forums. I am new to IS, but have tried to research this a lot. I am also maintaining someone else's code who is no longer here (and was not a IS expert either). Regardless it's not working.
GOAL:
I need to allow the user to specify a custom install path.

This is what I've done so far (yet it doesn't work).
1) For General Information->Product Properties the INSTALLDIR is set to:
->[ProgramFilesFolder]MyCompany\MyProduct
2) For ALL the components, the Destination is set to [INSTALLDIR]
3) In the function OnBegin, INSTALLDIR is initialized to:
INSTALLDIR = ProgramFilesFolder ^@COMPANY_NAME ^@PRODUCT_NAME;

4) the Ask Destination Path Dialog box has the following code:
Dlg_SdAskDestPath:
szTitle = @COMPANY_NAME;
szMsg = "";
nResult = SdAskDestPath(szTitle, szMsg, szDir, 0);
INSTALLDIR = szDir;
MessageBox (INSTALLDIR + " is the INSTALLDIR entered.", INFORMATION); //debug
MsiSetTargetPath(ISMSI_HANDLE, "TARGETPATH", szDir);
if (nResult = BACK) then
goto Dlg_SdLicense;
endif;

5) In the Dialog Dlg_SdStartCopy the following code exists:
Dlg_SdStartCopy:
szTitle = @COMPANY_NAME;
szMsg = "";
listStartCopy = ListCreate(STRINGLIST);
sz3 = @DEST_FOLDER + INSTALLDIR;
MessageBox("In OnFirstUIBefore sz3 is: " + sz3,INFORMATION); //debug
ListAddString(listStartCopy, sz3, AFTER);
FeatureSetTarget(MEDIA, "<INSTALLDIR>", INSTALLDIR);
MessageBox("called FeatureSetTarget and set it to INSTALLDIR: " + INSTALLDIR, INFORMATION); //debug
nResult = SdStartCopy(szTitle, szMsg, listStartCopy);
ListDestroy(listStartCopy);
if (nResult = BACK) then
goto Dlg_SdAskDestPath;
endif;
SetStatusWindow(0, "");
Enable(STATUSEX);
StatusUpdate(ON, 100);
return 0;

PROBLEM:
All of the MessageBox statements show that the INSTALLDIR is set to the path the user entered, yet when the Copy starts, the files ALWAYS goto C:\Program Files\MyCompany\MyProduct!!!
The rest of the install "breaks" since it uses files supposedly copied to the custom install path (the user entered). This files are in DEFAULT location instead.

Any help would be greatly appreciated!!! Thanks in advance.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 15 July 2004 - 08:35

From your question it looks like you are using the "InstallScript MSI" project type so I'm moving your post to the appropriate forum.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 15 July 2004 - 08:37

I don't follow your code exactly, but for starters I think your MsiSetTargetPath should set INSTALLDIR not TARGETPATH.

You could create a new test project and look at the default script to see how this is done properly.
(In general I find InstallScript MSI to be a quite confusing project type and perfer Basic MSI)

bbeachem

bbeachem
  • Members
  • 5 posts

Posted 15 July 2004 - 15:33

I am "forced" to maintain this code, which doesn't really need to be a Installscript MSI. Is there a way to "convert" this to a basic MSI or would I just have to redo the whole project?

Thanks for the help!

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 15 July 2004 - 21:07

Chaning to Basic MSI would basically mean to start over.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 16 July 2004 - 11:28

There are a couple of tricks you can use to transfer all components to a Basic MSI project, but you still need to create new custom actions and inserting them into the sequences. I did this with a project I created, and the time I spent doing it was regained later since I had less problems with the new setup.
Regards
-Stein Åsmul

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 16 July 2004 - 11:29

Here is a long description of pros and cons of different setup types:
http://forum.install...?showtopic=8734
Regards
-Stein Åsmul

bbeachem

bbeachem
  • Members
  • 5 posts

Posted 16 July 2004 - 15:55

Thank you all for the feedback/recommendations.

I made the modification of MsiTargetSetPath from "TARGETDIR" back to INSTALLDIR (this is the way I had it first before changing it to TARGETDIR). Neither work.

I am not using a MSI push to install this product. Every available dialog box and function within the InstallScript, related to the file transfer, has debug output in it. They all inidicate the path updated by the user for a custom install path. During the copy itself, I even have debug messages for INSTALLDIR and the destination parameter passed with MsiTargetSetPath that are the "user defined" yet the dialog shows them being copied to the default C:\ .

How do I find out where the script is pulling the destination location from ONCE the file copy has begun.

If your project is an Installscript MSI verses a Basic MSI does the ComponentTransfer call (or other functions related to file copying) behave differently? DOes the Installscript MSI not use INSTALLDIR for the destination folder?

Any ideas on further debug locations/calls before I make the change over?

luke_s

luke_s
  • Full Members
  • 532 posts

Posted 19 July 2004 - 07:46

I would run the install with verbose logging and find out exactly what paths are being used for your files. You can then go and change the appropriate code in your setup to match this.

If you look where each component is installing to, and at the directory table, this should help.