Indigo Rose Software
  #1  
Old 10-09-2004
Jason Pate Jason Pate is offline
Forum Member
 
Join Date: Jan 2002
Location: Nashville TN
Posts: 328
Huh? StatusDlg.SetTitle

I am doing a File.Copy and displaying the statusDlg is nice but I want to set the title. From best I can get, I need to create a function and call that function to do that. (if that is wrong please correct me) Problem is when I call the function I loose the rest of the statusdlg display info, aka the

Copy to info was nice, and I also loose the progress of the file copy, I am copying enough that the progress of the file copy info nice to display the users. I have tired setting some of the other options but with no luck.

If someone has a working example that would be great or if you can point out what’s wrong with my code.




cliniccount="clinic count"
clinicname="clinic name"
clinicname = Dialog.Input(clinicname.." ".."1 of "..cliniccount.." ".."Is entered next Please enter the next Clinic", "Clinic Name", "", MB_ICONQUESTION)

function copydisplay()
StatusDlg.SetTitle("SetTitle..Installing"..clinicn ame);
return
end

Folder.DeleteTree("C:\\test\\junk")
Folder.Create("C:\\test")
Folder.Create("C:\\test\\junk")

appfolder="C:\\test\\junk"
StatusDlg.Show(MB_ICONNONE, false)
File.Copy("C:\\test\\*.*", appfolder, true, true, false, true, copydisplay)

Last edited by Jason Pate; 10-09-2004 at 06:55 PM. Reason: typo
Reply With Quote
  #2  
Old 10-12-2004
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
I don't think you need a callback function to set the title bar...just do this:

Code:
StatusDlg.Show(MB_ICONNONE, false);
StatusDlg.SetTitle("Installing"..clinicname);
File.Copy("C:\\test\\*.*", appfolder, true, true, false, true, nil)
As for why your callback function wasn't working...you're accessing a global variable from inside the callback function; that value isn't going to change as the file is copied. The progress information is sent to the callback function via parameters, and when you use a callback function you have to do things like set the progress bar and all that using actions. In other words, if you want to replace the default status dialog, you need to replace its functionality. (As much or as little as you want.) It's designed so that you can display the progress information in any way you want -- or even choose not to display it and just track it internally for some purpose.

Code:
function copydisplay(strSource, strDestination, nCopied, nTotal)
    -- put actions in here to display the progress how you want
    return;
end
But if all you want to do is set the title of the built-in status dialog, just use StatusDlg.SetTitle before you call File.Copy.
__________________
--[[ Indigo Rose Software Developer ]]
Reply With Quote
  #3  
Old 10-12-2004
Jason Pate Jason Pate is offline
Forum Member
 
Join Date: Jan 2002
Location: Nashville TN
Posts: 328
function filecopy()
--INIFile.GetValue(SessionVar.Expand("%AppFolder%\\s ettings.ini"), count, Clinic)


StatusDlg.Show(MB_ICONNONE, false);
StatusDlg.SetTitle("Installing"..clinicname);
File.Copy(SessionVar.Expand("%AppFolder%\\*.*"), appfolder, true, true, false, true, nil)--funfilecopydisplay
end



I am calling this as a function under the resorces menu. But each time I run it the title is still Copying.
Attached Images
File Type: jpg dialogprogress.JPG (14.5 KB, 56 views)
Attached Files
File Type: zip 6.4 first try with function.zip (13.9 KB, 18 views)
Reply With Quote
  #4  
Old 10-12-2004
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
Try this instead:

Code:
function filecopy()
--INIFile.GetValue(SessionVar.Expand("%AppFolder%\\settings.ini"), count, Clinic)

StatusDlg.SetTitle("Installing"..clinicname);
StatusDlg.Show(MB_ICONNONE, false);
File.Copy(SessionVar.Expand("%AppFolder%\\*.*"), appfolder, true, true, false, true, nil); --funfilecopydisplay
end
__________________
--[[ Indigo Rose Software Developer ]]
Reply With Quote
  #5  
Old 10-12-2004
Jason Pate Jason Pate is offline
Forum Member
 
Join Date: Jan 2002
Location: Nashville TN
Posts: 328
No luck I am starting to feel like this is a BUG of some kind. I tried ALL weekend every different way I could to change this with no luck of getting it right at all.

If I get the title changes I loose the progress bar and everything else and that is inconstant. I do appericate your help. any idea's?



Quote:
function regsettings ()
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ReDoc Software\\"..clinicname, "clinicname", clinicname)
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ReDoc Software\\"..clinicname, "appfolder", appfolder)
Shell.CreateShortcut(_DesktopFolder, clinicname, msaccesspath, cmdline, appfolder..clinicname, appfolder.."\\ReDoc.ico", 0, SW_MAXIMIZE, nil, "This is the comment");
--Shell.CreateShortcut(_DesktopFolder, clinicname, msaccesspath, cmdline, SessionVar.Expand("%AppFolder%").."\\"..clinicname , SessionVar.Expand("%AppFolder%").."\\"..clinicname .."\\ReDoc.ico", 0, SW_MAXIMIZE, nil, "This is the comment");
end
function filecopy()
--INIFile.GetValue(SessionVar.Expand("%AppFolder%\\s ettings.ini"), count, Clinic)

StatusDlg.SetTitle("Installing"..clinicname);
StatusDlg.Show(MB_ICONNONE, false);
File.Copy(SessionVar.Expand("%AppFolder%\\*.*"), appfolder, true, true, false, true, nil)--funfilecopydisplay
end
Attached Images
File Type: jpg dialogprogress.JPG (15.6 KB, 35 views)
Reply With Quote
  #6  
Old 10-13-2004
Mark's Avatar
Mark Mark is offline
Indigo Rose Staff Member
 
Join Date: Jun 2000
Location: Indigo Rose Software
Posts: 1,773
Hi Jason,

This is actually by design, it was designed this way to make the process as simple as possible.

What is happening is because you are showing the Status Dialog and then running File.Copy() without the callback, Setup Factory is taking control of the status dialog and setting all text to appropriate values for the operation.

Setup Factory is setting the title of the dialog to be the localized string: MSG_COPYING

If you want to customize the title of the status dialog try something like the following code:


Code:
--Get the Localized string to set it back later
strLocString = SetupData.GetLocalizedString("MSG_COPYING");

--Change the localized string to your title
SetupData.SetLocalizedString("MSG_COPYING","Installing"..clinicname);

StatusDlg.Show(MB_ICONNONE, false);
 File.Copy(SessionVar.Expand("%AppFolder%\\*.*"), appfolder, true, true, false, true, nil);

--Reset the localized string
SetupData.SetLocalizedString("MSG_COPYING",strLocString);
Also, if you were to use a callback function to override the default text, you would have to set the progress and other options on the Status Dialog yourself.
__________________
MSI Factory The Next Generation Intelligent Setup Builder
Reply With Quote
  #7  
Old 10-13-2004
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
Sorry Jason, I was wrong...in order to change the title like that, you'll need to use a callback function or temporarily change the message string like Mark suggested.

There must be a difference between the SF7 in my head and the SF7 that actually exists.

Sorry about that.
__________________
--[[ Indigo Rose Software Developer ]]
Reply With Quote
  #8  
Old 10-13-2004
Jason Pate Jason Pate is offline
Forum Member
 
Join Date: Jan 2002
Location: Nashville TN
Posts: 328
Mark,

Thank you that worked!!! And its totally what I have been looking for.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -6. The time now is 01:30 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software