Problem for open a standalone from a CdRom

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Problem for open a standalone from a CdRom

Post by jmburnod » Mon Jul 11, 2011 11:35 am

Hi All,

I have a standalone for Mac
It work well when i open it from my hardDisk and also from an usbkey

But not directly from a CdRom
(if i copy it from de CDRom to my HardKisk it work)
There is no write at open, preopenstack, opencard, preopencard

Thank in advance for your lights

Jean-Marc
https://alternatic.ch

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by Mark » Mon Jul 11, 2011 7:43 pm

Jean-Marc,

What happens when you try to start the app from the CD-Rom?

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by jmburnod » Tue Jul 12, 2011 9:36 am

Hi Mark,

Thank for your reply
What happens when you try to start the app from the CD-Rom?
Il can open it but it stop working after the first cd of the mainstack is opened

I tried with a bug report and it return that

Type
Object card id 1002
Line put "Object" & tab & the short name of tObject & cr after tErrorString
Hint preOpenCard

I search, search... and i'll come back

Best regards
Jean-Marc
https://alternatic.ch

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by Mark » Tue Jul 12, 2011 9:44 am

Hi Jean-Marc,

I suspect that the line

put "Object" & tab & the short name of tObject & cr after tErrorString

isn't yours. Can you confirm that? Do you always include the bug reporting feature? If yes, turn it off. If no, can you give me a list of libraries that you use?

If the line is actually yours, can you post the script containing that line and can you figure out what's in the variable tObject? I think that tObject contains an absolute path to an object, which might cause a problem when the drive name or folder path changes.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by jmburnod » Tue Jul 12, 2011 9:58 am

Hi Mark,
isn't yours. Can you confirm that?
yes
Do you always include the bug reporting feature? If yes, turn it off. If no, can you give me a list of libraries that you use?
No and the list of libraries i use :

Font Support, Geometry, Internet,Printing,Speech

Best and thank again
Jean-Marc
https://alternatic.ch

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by Mark » Tue Jul 12, 2011 10:02 am

Jean-marc,

What happens if you don't include the geometry library? You'll need to remove all calls to the geometry library of course and you probably need to remove all geometry settings from all objects. There is a good chance that this is the source of the problem.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by jmburnod » Tue Jul 12, 2011 11:13 am

Hi Mark,

Same result without the geometry librairy
In my first message i said there is no write.It is correct, but i have a read from file
and If i suppress it the Cd-Rom work fine.

Of course i can suppress it, but i don't understand why it does problem.

I think the path of the folder which contains the file is correct.
This script build it :

Code: Select all

on FaitPathNec
   global gPathNec
   put the filename of this stack into bufPath
   put bufPath into gPathNec
   put the environment into pEnv
   put the itemdel into OID
   set the itemdel to "/"
   put the num of items of gPathNec into nbF
    if the platform = "MacOS" then 
      if pEnv = "standalone application" then
         delete item (nbF-3) to nbf of gPathNec
      end if
      if pEnv = "development" then
         delete last item of gPathNec
      end if
   else
      delete last item of gPathNec
   end if
   set the itemdel to OID
   put "/"&"LeNecessaire" after gPathNec
end FaitPathNec
Best

Jean-Marc
https://alternatic.ch

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by Mark » Tue Jul 12, 2011 12:37 pm

Jean-Marc,

Can you post your preOpenCard script?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by jmburnod » Tue Jul 12, 2011 1:24 pm

Hi Mark,

I solved the problem with a file in a folder of the Preferences folder of the user
Can you post your preOpenCard script?
Yes of course, the propencard handler and the linked handlers

Code: Select all

on preopencard
   global gLaCurCD,gdev
   put the short name of this cd into gLaCurCD 
   if the MonModeNav of this stack  = "AvBalai" then
      show group "grChgDelai"
   else
      hide group "grChgDelai"
   end if
   ajusteBtnModeNav
   ajustLesParleur
   placeSlider
   AjusteLesDeja
   set the top of grc "Entoure" to 4000
end preopencard

on ajusteBtnModeNav
   put the MonModeNav of this stack into bufMN
   if bufMN = "AvSouris" then
      put "bSouris" into bufNombtn
   end if
   
   if bufMN = "AvClavAl" then
      put "bDeuxC" into bufNombtn
   end if
   
   if bufMN = "AvBalai" then
      put "bunC" into bufNombtn
   end if
   ajusteModeNav bufNombtn
end ajusteBtnModeNav

on ajusteModeNav n --•• afficher le modenav
   put n into MonNom
   put "bSouris,bUnC,bDeuxC" into LesB
   put the num of items  of LesB into nb
   repeat with i = 1 to nb
      put item i of LesB into UnB
      if UnB = MonNom then
         set the hilite of btn UnB to true
         next repeat
      end if
      set the hilite of btn UnB to false
   end repeat
   
   if MonNom = "bunC" then
      set the MonModeNav of this stack to "AvBalai"
      set the blendlevel of  img "iPasser" to 0
   end if
   
   if MonNom = "bDeuxC" then
      set the MonModeNav of this stack to "AvClavAl"
      set the blendlevel of img "iPasser" to 0
   end if
   
   if MonNom = "bSouris" then
      set the MonModeNav of this stack to "AvSouris"
      set the loc of grc "Entoure" to 4000,4000
      set the blendlevel of img "iPasser" to 100
   end if
end ajusteModeNav

on ajustLesParleur
   put the MaSynthVoc of this stack into bufMP
   put the MonParleurTexte of this stack  into bufMPtexte
   put the MonParleurInfos of this stack  into bufMPinfos
   set the hilite of btn "bParleurTexte" to bufMPtexte
   set the hilite of btn "bParleurInfos" to bufMPinfos
   if bufMP then
      EnaLesParleur
   else
      DisLesparleur
   end if
end ajustLesParleur

on  EnaLesParleur
    set the MaSynthVoc of this stack to true
   put "bParleurTexte,bParleurInfos" into LesP
   repeat with i = 1 to the num of items of Lesp
      put item i of LesP into UnP
      set the blendlevel  of btn UnP to 0
      enable btn UnP
   end repeat
 revloadSpeech
end EnaLesParleur

on DisLesparleur
   set the MaSynthVoc of this stack to false
   set the MonParleurTexte of this stack to false
   set the MonParleurInfos of this stack to false
   put "bParleurTexte,bParleurInfos" into LesP
   repeat with i = 1 to the num of items of Lesp
      put item i of LesP into UnP
      set the blendlevel  of btn UnP to 75
      disable btn UnP
   end repeat
   revUnloadSpeech
end DisLesparleur

on PlaceSlider
   put the left of grc "HsliderbarG" into MinL
   put the defdelai of this stack into UnDelai
   put item 1 of UnDelai into LaLeft
   set the left of grc "LeSlider" to laLeft+MinL
   put item 3 of UnDelai into EnSec
   put Ensec&&"sec." into fld "theValue_h"
   put the loc of fld "theValue_h" into LocF
   put the loc of grc "LeSlider"  into LocS
   put item 1 of LocS into item 1 of LocF
   set the loc of fld "theValue_h" to LocF
end PlaceSlider

on AjusteLesDeja
   global gMesDejaVus
   repeat with i = 1 to 10
      put "deja"&i into Undeja
      if line i of gMesDejaVus <> 0 then
         show btn Undeja
         if line i of gMesDejaVus = 2 then
             PlaceLesSouris i
         end if
      else
         hide btn Undeja
      end if
   end repeat
end AjusteLesDeja
I promess i modify same "repeat with" :oops:

Best

Jean-Marc
https://alternatic.ch

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by Mark » Tue Jul 12, 2011 1:59 pm

Hi Jean-Marc,

Let's start with modifying the preOpenCard handler.

Code: Select all

on preopencard
	try
		global gLaCurCD,gdev
		put the short name of this cd into gLaCurCD
		if the MonModeNav of this stack  = "AvBalai" then
			show group "grChgDelai"
		else
			hide group "grChgDelai"
		end if
		ajusteBtnModeNav
		ajustLesParleur
		placeSlider
		AjusteLesDeja
		set the top of grc "Entoure" to 4000
	catch myErr
		answer myErr
	end try
end preopencard
Do you see an error if you run this from CD? Can you make a screenshot of the error and post it?

You also might want to change the ajusteBtnModeNav handler to make sure that no unnecesary errors occur:

Code: Select all

on ajusteBtnModeNav
	put the MonModeNav of this stack into bufMN
	if bufMN = "AvSouris" then
		put "bSouris" into bufNombtn
	else if bufMN = "AvClavAl" then
		put "bDeuxC" into bufNombtn
	else if bufMN = "AvBalai" then
		put "bunC" into bufNombtn
	else
		put empty into bufNombtn
	end if
	if bufNombtn is not empty then
		ajusteModeNav bufNombtn
	else
		beep
		answer error "bubNomBtn is empty"
	end if	
end ajusteBtnModeNav
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by jmburnod » Tue Jul 12, 2011 4:24 pm

Hi Mark,

Thank a lot for your lights
Do you see an error if you run this from CD?
No error with new standalone with the news preopencard and ajusteBtnModeNav (no answer dialog, no bug report)

I resume :
This standalone work fine from the HD and from an usbKey.
From CD it stop working
1. The bug report said the error is in the preopencard
2. After i suppress a "read from file" at preopenstack, the problem disappear (the file is now in the preference folder of the user)

In this case it is ok but why the standalone can't read a file from the CD-Rom (the path is correct)

I have an handler "verifVocal" (to verify if there is a vocal synthesis) at preopenstack
Maeby it is the start of the problem

Code: Select all

on verifVocal --•• verif présence synthese vocale
   put revGetSpeechVolume() into oldVolVS
   revSetSpeechVolume 0
   put "Juste un test" into  bufT 
   try 
      revSpeak bufT
      wait until revIsSpeaking() is false
   catch theError 
   end try
   
   if theError = empty then
      EnaLesParleur --•• enable btn Parleurs
   else
      DisLesparleur --•• disable btn Parleurs
   end if
   revSetSpeechVolume oldVolVS
   -- dansmes theError
end verifVocal
Best

Jean-Marc
https://alternatic.ch

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Problem for open a standalone from a CdRom

Post by Klaus » Tue Jul 12, 2011 4:31 pm

Hi Jean-Marc,
jmburnod wrote:...
2. After i suppress a "read from file" at preopenstack, the problem disappear (the file is now in the preference folder of the user)
AHA! You did not tell about this one!

Try to use the URL syntax, since "open file..." will really try to open a file but it is
WRITE PROTECTED on the CD,so this might throw the error!?
...
put url "file:file.txt" into tFileContent
...

Best

Klaus

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by Mark » Tue Jul 12, 2011 4:36 pm

Hi Jean-Marc,

I'm a little confused. If you don't get any error message with my modified script, assuming that you included the answer dialog in your standalone, I'd say that the problem is solved? Am I wrong?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by Mark » Tue Jul 12, 2011 4:38 pm

Klaus,

I really can't imagine that files can't be opened the old-fashioned way on a write-protected volume. If this is true, then it is a LiveCode bug, unless "open file x for read" still works.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by jmburnod » Tue Jul 12, 2011 4:55 pm

Hi Mark and Klaus

Mark said :
I'd say that the problem is solved?
Yes. After i suppress the "read from file" at propenstack and i don't undertand why.

Klaus said :
AHA! You did not tell about this one!
For me it is possible to read a file from a locked volume at preopenstack :oops:

The bug report of the standalone return the error is at preopencard

I want understand why a modification in the preopenstack script solving an error at preopencard

Best

Jean-Marc
https://alternatic.ch

Post Reply