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

Problem With Wscript.scriptfullname in an CA


6 replies to this topic

mangoust

mangoust
  • Members
  • 4 posts

Posted 30 December 2005 - 15:47

Hello,

I have an problem with "Wscript.scriptfullname" in an custom action in Installshield 10.5

Excuse for my bad english...

I have write an script vbs and I search an equivalent (or similar) command for wscript.scriptfullname..

i have write :

QUOTE

'Set WshShell = CreateObject("WScript.Shell")
'Set Oshell  = CreateObject("Wscript.Shell")
Set wscript= CreateObject("Wscript.shell")
Set fso = CreateObject("Scripting.FileSystemObject")

'Oshell.sleep 100

RepScriptFullName = Wscript.ScriptFullName
'
' RepScriptFullName = fso.GetAbsolutePathName(".")
RepScriptName    = wscript.ScriptName

Msgbox "RepScriptFullName : " & RepScriptFullName & VBCRLF & "RepScriptName : " & RepScriptName


This function goes well on normal Windows
The function GetAbsolutePathName is bad for me.. or does not satisfy

Exist there a means of knowing the way of script carried out complete ?

Thank you for your help..



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 01 January 2006 - 17:27

Use Windows Installer's built in script host, i.e. remove Wscript.

mangoust

mangoust
  • Members
  • 4 posts

Posted 01 January 2006 - 20:38

Thank you for your answer.

But Before : Allow me to present a Happy New Year 2006


But, I am sorry.

I do not understand what you want to specify.

I understood well that "Wscript" is banished.
But by what do I have to replace it "Installer" ?

or please think to me that I should use the functionality "New Script in Custom Action" ?.

I carried out tests via this procedure but that does not go.

Thank for your help..

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 02 January 2006 - 23:52

In WScript.exe and CScript.exe, WScript.ScriptFullName returns the full name of the (vbs) file currently being executed. WScript and CScript just read the contents of that file, and execute it.
In Windows Installer this concept makes no sense. There is no VBS file or anything like that, only an MSI. Therefore you won't find anything like ScriptFullName. I wonder what you want to achieve?

Windows Installer offers alternatives, for instance you can retrieve the ProductName property, or the MSI file location. I don't think a script can retrieve the name of the CA being executed - at least I never found it. If you find a way, let me know!



Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 03 January 2006 - 07:48

I don't understand quite what you want to achieve either, but if you need the folder from which the install is running you could try:
Session.Property("SourceDir") from within a VBScript. This will only work if SourceDir has been resolved, so make sure you insert it after costing or add the ResolveSource standard action.
Regards
-Stein Åsmul

mangoust

mangoust
  • Members
  • 4 posts

Posted 03 January 2006 - 21:46

Thank you for your answers.

Indeed, that does not function with all that touches in "Wscript.xxxx" in a msi.. On the other hand, I had tested property "SOURCEDIR", but that left me to white.

Today, I have remakes the tests and the order of the sequence was not good. I have indeed the information which is necessary for me.

But, that functions only in mode ' Immediate' Execution in "CA" et not in mode "Commit Execution".. Arrggghhhh

In front of this fact, I used the module "ini" to record property "SOURCEDIR" and other properties which I have need. I'm developed a script which enables me to read these properties in mode "Commit Execution" on CA.

And I would thus hold you with the current if that functions or not.

Thank You


mangoust

mangoust
  • Members
  • 4 posts

Posted 06 January 2006 - 23:05

Hello,

As promised, I reconsider the subject. The method employed is well what I described in the precedent post..

That functions well.

Thank you for your help..

Edited by mangoust, 06 January 2006 - 23:08.