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

browse from cd (reformatted)


6 replies to this topic

sachin123

sachin123
  • Members
  • 26 posts

Posted 23 July 2003 - 07:09

hi,

i have the following two questions.



1.in basic msi project, i have a requirement where in
i have a dialog where in user has option to install to local drive
or browse from cd.
when browse from cd is selected, i show the ready to install screen of the basic msi project ,
quiet similar to what i do when i install local drive.

on clicking on "installnow" button
i have put the following condition,where in
i call a custom script which just creates shortcuts on desktop and writes a custom registry key through a doaction condition.

Then i call a "new dialog" to call setupcomplete dialog when browse from cd is selected after running the custom script,
the setup complete dialog gets displayed. when i click on "finish"
button the setupcompelte dialog is shown again with a message saying that setup was interputted.

I think i need to set some property to prevent this message as
i am not actually installing when browse from cd option is selected, just
writing to registry and creating shorcuts.





2.

Also if setup.exe is clicked again when it is already installed(assuming
user had selected to browse from cd during the installtion),i need to remove the registry which
i had created through custom script.What i observed is that when i install
the contents to a local m/s install shield writes some registry keyes, but
when i selected to browse from cd option on my dialog during installation, all i did was to created the shortcut and wrote some custom
keyes to registry, what i want to know is that how do i
force setup.exe to show maintainence dialog as install shield actually did not install
any content when browse from cd was selected as only shortcuts was created,registry entries were made
through custom scripts.





Neo

Neo
  • Members
  • 48 posts

Posted 24 July 2003 - 15:00

Hi Sachin

You could probably have this as a workaround for your problem.

When the user selects the CDROM option, use a script to set all the features in your project, except the one that creates the shortcuts, to INSTALLSTATE_ABSENT and let it proceed with the install. You can do this using the function MsiSetFeatureState to get the desired effect. So only the feature which has the shortcut will get installed.

Usage of MsiSetFeatureState:
MsiSetFeatureState(hMSI,"MyFeature",INSTALLSTATE_ABSENT)


This also solves your second problem. Setup will automatically go to maintanence mode now.

Regards

Neo

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 24 July 2003 - 20:23

Is there a particular reason you don't want to use INSTALLSTATE_SOURCE for this purpose? (Or am I misinterpreting your intention?)

sachin123

sachin123
  • Members
  • 26 posts

Posted 25 July 2003 - 19:44

stefan,

actually i am not installing anything when browse from cd option is selected.
just creating shortcuts pointing to the exe present in the cd.
so i had my own ready to install screen, where i called script to create and shortcut and now i want to show the completion dialog,so i has my own setupcomplete dialog quiet similar to the setupcompletesuccess dialog.
but when i click on the finish button on my dialog, it shows me a setup interputted dialog, let me know how can this resolved.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 25 July 2003 - 21:26

Well, installing with INSTALLSTATE_SOURCE will also leave all application files on the CD. All you get is shortcuts, registry entries (if any) and an entry in Add/Remove Programs control panel.

sachin123

sachin123
  • Members
  • 26 posts

Posted 25 July 2003 - 22:42

Hi Stefan,

I tried calling the below function.
But i am unable to get this working as it hangs when
I this function.I went through the help, it
says that we need to call MsiSetInstallLevel() before MsiSetFeatureState().
I even tried calling it, but it still hangs.

let me know if I am doing anything wrong.


/////////////////////////////////////////////////////////////////////////////////

function Media(hMSI)

begin
MessageBox("working till here",INFORMATION);

MsiSetInstallLevel(hMSI,0); // hangs here.
MessageBox("not coming here",INFORMATION);

MsiSetFeatureState(hMSI,"Myfeature",INSTALLSTATE_SOURCE);
end;
////////////////////////////////////////////////////////////////////////////////////

sachin123

sachin123
  • Members
  • 26 posts

Posted 28 July 2003 - 04:01

Hi stefan,

I read that using msisetfeature hangs so i changed to the below code(vb script custom action),
but i get 1720 error.let me know if some-thing is wrong in the code.
////////////////////////////////////////////
Dim ObjInst
Dim sPcode

Set ObjInst =Server.CreateObject("WindowsInstaller.Installer")
sPcode = Session.Property("ProductCode")
ObjInst.ConfigureFeature(sPcode,"TLInstaller",4)
////////////////////////////////////


But i want the registry keyes which install shield writes , to be written even if
no physical files are installed on the client m/s.