|
-
Apr 26th, 2007, 01:02 AM
#1
Thread Starter
Fanatic Member
Re: Vista and VB6 issue...
 Originally Posted by Darkbob
Now just need to figure out how to get Inno to put the stuff in the right place.
--DB
Interesting question. I use Inno as well and I would very much like to know how it is possible to tell Inno to install the application in the right folder. Obviously, the destination folder should be valid for all versions of Windows because we don't know whether the final user has Vista or not.
Any help?
P.S. I was thinking it could be a good idea to install, not only the files, but also the application itself in the public folder, so everybody will be able to use it and the "virtualization redirects" will not take place. What do you think?
Last edited by esposito; Apr 26th, 2007 at 01:08 AM.
Since I discovered Delphi and Lazarus, VB has become history to me.
-
Apr 26th, 2007, 01:07 AM
#2
Re: Vista and VB6 issue...
Yes, there is an Environmental variable for it:
%ALLUSERSPROFILE%
XP:
C:\Documents and Settings
Vista:
C:\Users
or C:\Users\Public
Not 100% sure but you could just add the "\Public" part if on Vista.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 26th, 2007, 01:48 AM
#3
Re: Vista and VB6 issue...
@esposito, check out db's thread in the AD forum for Inno info.
http://vbforums.com/showthread.php?t=465433
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 26th, 2007, 10:56 AM
#4
Thread Starter
Fanatic Member
Re: Vista and VB6 issue...
 Originally Posted by RobDog888
Thanks. Anyway, I still have to figure out if there is any safe way to install an application under all versions of Windows, i.e. a public folder that is seen as public not only under Vista but also under XP, Millennium, 98 etc.
Since I discovered Delphi and Lazarus, VB has become history to me.
-
Apr 26th, 2007, 01:16 PM
#5
Re: Vista and VB6 issue...
Well you would have to use OS detection and handle each as needed in the installer code. I remember you are using an installer that is not widely used at least seen on VBF but it sounded like it may have the capabilities.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 26th, 2007, 03:24 PM
#6
Thread Starter
Fanatic Member
Re: Vista and VB6 issue...
 Originally Posted by RobDog888
Well you would have to use OS detection and handle each as needed in the installer code. I remember you are using an installer that is not widely used at least seen on VBF but it sounded like it may have the capabilities.
I'm afraid Inno does not allow you to detect the OS and act accordingly. At least, as far as I know. If I am mistaken, please let me know how to proceed.
Since I discovered Delphi and Lazarus, VB has become history to me.
-
Apr 26th, 2007, 03:53 PM
#7
Re: Vista and VB6 issue...
Use the %OS% to see its platform.
Windows_NT is the same for NT 4 to Vista
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 27th, 2007, 01:50 AM
#8
Thread Starter
Fanatic Member
Re: Vista and VB6 issue...
 Originally Posted by RobDog888
Use the %OS% to see its platform.
Windows_NT is the same for NT 4 to Vista 
The following is an Inno script I have created for the installation of one of my programs. I can't see the %OS% key. Am I missing something?
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
AppName=Bollettini Postali Pro ICI 2.0
AppVerName=Bollettini Postali Pro ICI 2.0
AppPublisher=Software by Pasquale Esposito
AppPublisherURL=http://www.espositosoftware.it
AppSupportURL=http://www.espositosoftware.it
AppUpdatesURL=http://www.espositosoftware.it
DefaultDirName={pf}\Bollettini Postali Pro ICI 2.0
DefaultGroupName=Bollettini Postali Pro ICI 2.0
AlwaysCreateUninstallIcon=yes
LicenseFile=D:\Bollettini_ICI\Licenza.txt
InfoBeforeFile=D:\Bollettini_ICI\Istruzioni.txt
; uncomment the following line if you want your installation to run on NT 3.51 too.
MinVersion=4,3.51
[Tasks]
Name: "desktopicon"; Description: "Crea icona sul &desktop"; GroupDescription: "Funzioni aggiuntive:"; MinVersion: 4,4
[Files]
Source: "D:\Bollettini_ICI\Bollettini.exe"; DestDir: "{app}"; CopyMode: alwaysoverwrite
Source: "D:\Bollettini_ICI\Guida.pdf"; DestDir: "{app}"; CopyMode: alwaysoverwrite
Source: "D:\Bollettini_ICI\Informazioni.txt"; DestDir: "{app}"; CopyMode: alwaysoverwrite
Source: "D:\Bollettini_ICI\Bollettini.ini"; DestDir: "{app}"; CopyMode: alwaysoverwrite
Source: "D:\Bollettini_ICI\unins000.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite
Source: "D:\Bollettini_ICI\msvbvm50.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: uninsneveruninstall sharedfile regserver
[INI]
Filename: "{app}\Bollettini_ICI.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.espositosoftware.it"
[Icons]
Name: "{group}\Bollettini Postali Pro ICI 2.0"; Filename: "{app}\Bollettini.exe"
Name: "{group}\Guida di Bollettini Postali Pro ICI 2.0"; Filename: "{app}\Guida.pdf"
Name: "{group}\Leggimi"; Filename: "{app}\Informazioni.txt"
Name: "{group}\Sito Internet dell'autore"; Filename: "{app}\Bollettini_ICI.url"
Name: "{userdesktop}\Bollettini Postali Pro ICI 2.0"; Filename: "{app}\Bollettini.exe"; MinVersion: 4,4; Tasks: desktopicon
[Run]
Filename: "{app}\Bollettini.exe"; Description: "Esegui Bollettini Postali Pro ICI 2.0"; Flags: nowait postinstall skipifsilent
[UninstallDelete]
Type: files; Name: "{app}\Bollettini_ICI.url"
Since I discovered Delphi and Lazarus, VB has become history to me.
-
Apr 27th, 2007, 01:54 AM
#9
Re: Vista and VB6 issue...
Posts split to a new thread and moved to the application forum. 
The %OS% is an environmental variable, not an Inno function.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 27th, 2007, 02:03 AM
#10
Thread Starter
Fanatic Member
Re: Vista and VB6 issue...
 Originally Posted by RobDog888
Posts split to a new thread and moved to the application forum. 
The %OS% is an environmental variable, not an Inno function.
You will have to forgive me but I don't know what an environmental variable is. Can you help me?
Since I discovered Delphi and Lazarus, VB has become history to me.
-
Apr 27th, 2007, 02:06 AM
#11
Re: Vista and VB6 issue...
Sure, np. An environmental variable is a Windows system variable. If you right click on My Computer and click Properties > Advanced > Environmental variable button > System Variables section > scroll down to "OS". The right side pane will show its value.
The %OS% syntax only specifies its a macro or environment variable and how it is to be evaluated.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 27th, 2007, 02:09 AM
#12
Thread Starter
Fanatic Member
Re: Vista and VB6 issue...
 Originally Posted by RobDog888
Sure, np. An environmental variable is a Windows system variable. If you right click on My Computer and click Properties > Advanced > Environmental variable button > System Variables section > scroll down to "OS". The right side pane will show its value.
The %OS% syntax only specifies its a macro or environment variable and how it is to be evaluated.
I see. And how can I exploit it through VB6 or Inno?
Since I discovered Delphi and Lazarus, VB has become history to me.
-
Apr 27th, 2007, 02:20 AM
#13
Re: Vista and VB6 issue...
Sure Inno Setup lets you determine which OS and then you can install appropriately. I do it all the time in the AutoOSUpdater (Hense the name).
The parameters are called MinVersion and OnlyBelowVersion.
The help documentation is a great place to look for these things...
-
Apr 27th, 2007, 02:23 AM
#14
Re: Vista and VB6 issue...
And that's not an Inno Script (**********) that's an Inno Setup Script. Quite different.
BTW: You used the Inno Setup Wizard so you definitely do not have all the dependencies that you need. The Inno Setup Wizard does not have the capabilities to do that. ********** does...
-
Apr 27th, 2007, 02:26 AM
#15
Re: Vista and VB6 issue...
Randem, dont you have an example recently posted on using the environmental variable(s) in a script?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 27th, 2007, 02:30 AM
#16
Re: Vista and VB6 issue...
No, example just the info from the Inno Setup help http://www.vbforums.com/showthread.php?t=465433
But he would be better of using MinVersion and OnlyBelowVersion to check the OS versions.
-
May 2nd, 2007, 09:48 AM
#17
Thread Starter
Fanatic Member
Re: Vista and VB6 issue...
 Originally Posted by randem
And that's not an Inno Script (**********) that's an Inno Setup Script. Quite different.
BTW: You used the Inno Setup Wizard so you definitely do not have all the dependencies that you need. The Inno Setup Wizard does not have the capabilities to do that. ********** does...
To sum up, C:\Users\Public does not exist under XP. So, you can't target that folder as the default installation path under WinXP.
C:\Users\Public is a "safe" folder under Vista because it avoids the problem with the Virtualization Files and you can be sure that all the data will be saved in the application path, as they are under WinXP.
Now, the problem is, I must find a way to make Inno detect the OS, so that, if it is XP, it will leave C:\Program Files as the target folder whereas, if it is Vista, it will set C:\Users\Public instead.
The Inno Setup Wizard does not have the capabilities to do that (detect the target OS and act accordingly), while ********** does.
It is clear that I have to deepen my knowledge of **********. So, what is it exactly? Is it code that must eventually be copied to the Inno Setup Script?
Since I discovered Delphi and Lazarus, VB has become history to me.
-
May 2nd, 2007, 01:34 PM
#18
Re: Vista and VB6 issue...
********** is a scripting program that packages your Inno Setups for you. Basically an extension on Inno. I dont believe you need to interact with Inno but do need it installed as it works with it.
Have you checked out the FAQ on Randems site?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 2nd, 2007, 01:46 PM
#19
Thread Starter
Fanatic Member
Re: Vista and VB6 issue...
 Originally Posted by RobDog888
********** is a scripting program that packages your Inno Setups for you. Basically an extension on Inno. I dont believe you need to interact with Inno but do need it installed as it works with it.
Have you checked out the FAQ on Randems site?
I took a quick look at Randem's site and I could understand that ********** is a tool that detects all the dependencies of your application and produces an Inno Setup Script (.iss file).
My problem is slightly different: I would like to know how (and if) it is possible to tell Inno to detect whether the current OS is Vista. If it is Vista, it should automatically change the default installation path from C:\Program Files to C:\Users\Public.
Do you think Inno is able to do that?
P.S. By the way, it is clear that it is my intention to install all the application files (executable included and not only the database files) in the C:\Users\Public folder simply because my application stores the data in the app path.
Last edited by esposito; May 2nd, 2007 at 01:50 PM.
Since I discovered Delphi and Lazarus, VB has become history to me.
-
May 2nd, 2007, 02:28 PM
#20
Re: Vista and VB6 issue...
Use MinVersion and OnlyBelowVersion flags to detect the OS.
And you can default to any folder you like... DefaultDir parameter
-
May 2nd, 2007, 02:41 PM
#21
Thread Starter
Fanatic Member
Re: Vista and VB6 issue...
 Originally Posted by randem
Use MinVersion and OnlyBelowVersion flags to detect the OS.
And you can default to any folder you like... DefaultDir parameter
Do you have any ready-made code like that? I don't have any experience in using Inno Script. All I have used so far is the Inno Setup Wizard that gave me the code ready for use.
Since I discovered Delphi and Lazarus, VB has become history to me.
-
May 2nd, 2007, 02:43 PM
#22
Re: Vista and VB6 issue...
That is what ********** is for...
-
May 2nd, 2007, 03:26 PM
#23
Thread Starter
Fanatic Member
Re: Vista and VB6 issue...
OK. This is an excerpt from the Inno Web site:
Here is a simple example of how to install one file on NT platforms (Windows NT/2000/XP) and another file on non-NT platforms (Windows 95/98/Me):
[Files]
Source: "{app}\WinNT2000.exe"; DestDir: "{app}"; MinVersion: 0, 1
Source: "{app}\Win9598Me.exe"; DestDir: "{app}"; MinVersion: 1, 0
"0" means never install; "1" means install on any version (i.e. version 1.0 or later).
Now, first of all, I can't see how you can tell Windows Vista apart from the other NT platforms and, secondly, I don't know how you can change the destination directory conditionally, on the basis of the previous check on the OS.
Any help will be appreciated.
Since I discovered Delphi and Lazarus, VB has become history to me.
-
May 2nd, 2007, 04:22 PM
#24
Re: Vista and VB6 issue...
Windows Vista returns a version of 6.0
-
May 17th, 2007, 07:54 AM
#25
Fanatic Member
Re: Vista and VB6 issue...
Ok... so let's clear this up once and for all...
I have an app with data files. I can put in two install lines. One for Vista and one for everything else..
;for vista
Source: C:\APP\DATA\*.*; DestDir: C:\Users\Public\MyApp\Data; Flags: ???
;for everything else
Source: C:\APP\DATA\*.*; DestDir: {App}\Data; Flags: ???
Can someone help me fill in the blanks? What should I put in place of ??? (assuming it's something like Minversion 0,6??? for one of them?)
Many thanks for your help!
--DB
-
May 17th, 2007, 01:00 PM
#26
Re: Vista and VB6 issue...
For everything
Source: C:\APP\DATA\*.*; DestDir: C:\Users\Public\MyApp\Data; Flags: OnlyBelowVersion: 0,6
It wont install these files on Vista, but on everything else.
-
May 17th, 2007, 01:17 PM
#27
Re: Vista and VB6 issue...
FROM INNO SETUP HELP
OnlyBelowVersion:
Format:
a.bb,c.dd, where a.bb is the Windows version, and c.dd is the Windows NT version.
Default value:
0,0
Description:
This directive lets you specify a minimum version of Windows or Windows NT that your software will not run on. Specifying "0" for one of the versions means there is no upper version limit. Build numbers and/or service pack levels may be included in the version numbers.
This directive is essentially the opposite of MinVersion.
-
May 18th, 2007, 10:10 AM
#28
Fanatic Member
Re: Vista and VB6 issue...
Well that's half the battle. We have filled in the "everything else" flags. But what about the only Vista flags? Presumably we use the MinVersion? So the answer would be:
;for vista
Source: C:\APP\DATA\*.*; DestDir: C:\Users\Public\MyApp\Data; MinVersion 0,6
;for everything else
Source: C:\APP\DATA\*.*; DestDir: {App}\Data; OnlyBelowVersion: 0,6
Hope I got that right?
--DB
-
May 18th, 2007, 11:09 AM
#29
Re: Vista and VB6 issue...
-
May 20th, 2007, 01:56 PM
#30
Fanatic Member
Re: Vista and VB6 issue...
Darkbob
Finally I have found someone who understands what randem is talking about, I hope.
You say:
Well that's half the battle. We have filled in the "everything else" flags. But what about the only Vista flags? Presumably we use the MinVersion? So the answer would be:
;for vista
Source: C:\APP\DATA\*.*; DestDir: C:\Users\Public\MyApp\Data; MinVersion 0,6
;for everything else
Source: C:\APP\DATA\*.*; DestDir: {App}\Data; OnlyBelowVersion: 0,6
Hope I got that right?
And then (joy of joys) randem says “Yes, That is correct”
Now first let me explain myself, I am a registered user of ********** and of course use inno for which I have donated.
I in the past have asked questions on the ********** forum and to his credit randem has answered but in dealing with randem in this way is hard work to say the least (like getting blood from the proverbial stone), his first reply usually says something like its in the help file or its on the inno web-site but the bottom line it is not or not in the form that is readily understood else I for one would not be asking the question in the first place.
Let me just say at the outset that I use inno and I have bought ********** because I don’t know how to write an install routine, I just get by writing my small applications and would like to be able to distribute them properly which is why I use **********. Not because I am completely familiar with VB and VB.net and just cannot be bothered to use there products to make a CAB file.
Now to get back to the plot as I said I write and distribute small applications across the world and a few times they did not work this was I found when some foreign language versions of windows did not install my application in the correct directory i.e. C:\Program Files\JS, when using the DefaultDirName= {pf}\My Program. So as a result of that I now write all my inno scripts with the location hard coded as above.
Now I would love to be able to have a script that in the case of Vista installed my application in the directory C:\Users\Public\JS and in the case of all other windows versions installed it in C:\Program Files\JS.
Now Please Please Darkbob or the Mighty randem how do I do it
Last edited by JohnSavage; May 20th, 2007 at 02:00 PM.
-
May 20th, 2007, 02:16 PM
#31
Re: Vista and VB6 issue...
In order to do that you would need to do something like the code below. Of course you need to change the code to return the constant you want by checking the OS inside the code routine. Klienma could possibly help with the code. He does Pascal coding for Inno Setup.
Code:
[Setup]
DefaultDirName={code:MyConst}\My Program
[Code ]
function MyConst(Param: String): String;
begin
Result := ExpandConstant('{pf}');
end;
-
May 20th, 2007, 04:07 PM
#32
Re: Vista and VB6 issue...
It took me a while (my Pascal day are long behind me) but here is what you need:
Code:
[Setup]
DefaultDirName={code:GetAppFolder}\Randem Systems\**********\********** 6.0
[Code ]
var s: Integer;
function GetAppFolder(Param: String): String;
begin
s := InstallOnThisVersion('0','6');
if s = 0 then
Result := 'C:\Users'
else
Result := ExpandConstant('{pf}');
end;
-
May 20th, 2007, 04:17 PM
#33
Fanatic Member
Re: Vista and VB6 issue...
randem,
Firstly many thanks for the reply, but just to check that I understand you correctly, using my example locations above is this correct
Code:
[Setup]
DefaultDirName= C:\Program Files\JS
[Code ]
var s: Integer;
function GetAppFolder(Param: String): String;
begin
s := InstallOnThisVersion('0','6');
if s = 0 then
Result := ' C:\Users\Public\JS '
else
Result := ExpandConstant('C:\Program Files\JS');
end;

ps while you are in a good mood could you look at the new post I have just made?
-
May 20th, 2007, 06:38 PM
#34
Re: Vista and VB6 issue...
I would do it this way...
Code:
[Setup]
DefaultDirName= {code:GetAppFolder}\JS
[Code ]
var s: Integer;
function GetAppFolder(Param: String): String;
begin
s := InstallOnThisVersion('0','6');
if s = 0 then
Result := ' C:\Users\Public '
else
Result := ExpandConstant('{pf}');
end
The way you did it Nothing would change for you never called the function.
-
May 21st, 2007, 04:56 AM
#35
Fanatic Member
Re: Vista and VB6 issue...
Randem,
As I said early in this thread not all versions of windows use the C:\Program Files\ default location when you use DefaultDirName={pf}\My Program script, some foreign language versions of windows would install the application in another directory if you use the {pf} script. My problem would be in this situation my application would not be able to find it’s database because it would not have been installed in the location C:\Program Files\JS but somewhere else.
So in an effort to know were my application would end up and then I can alter the code in my path using an if then else statement I need to know were it is going to be installed.
So would this do it?
Code:
Code:
[Setup]
DefaultDirName= {code:GetAppFolder}\JS
[Code ]
var s: Integer;
function GetAppFolder(Param: String): String;
begin
s := InstallOnThisVersion('0','6');
if s = 0 then
Result := ' C:\Users\Public '
else
Result := ExpandConstant('c:\Program Files');
end
I just thought of this now as I was typing is, a final question if I may, if I hard code my path to C:\Users\Public\JS for all versions of windows would this be a problem for XP and the other versions below it?
-
May 21st, 2007, 12:42 PM
#36
Re: Vista and VB6 issue...
Hardcoding that path would not incur any problems in any OS. {pf} should return the environmental setting for ProgramFiles which should not care what language you are using. What ever is in the environmental value is where the program should be installed.
-
May 21st, 2007, 02:22 PM
#37
Fanatic Member
Re: Vista and VB6 issue...
Randem,
What I mean by hard coding the path is to use the statement
Code:
DefaultDirName=C:\Program Files\JS
Not
Code:
DefaultDirName={pf}\JS
As I have explained if you use {pf} in some XP versions then my application does not end up in a folder called C:\Program Files\JS it ends in a folder C:\Archivos de programa\JS.
Now if this happens then as I have said my application would not work as it would not find it’s database.
So I ask again if I script inno to say
Code:
DefaultDirName= C:\Users\Public\JS
for all versions of windows (Vista,XP, ME, Win 98 etc) is that OK, because in this way I always know where it will end up.
-
May 21st, 2007, 07:27 PM
#38
Re: Vista and VB6 issue...
Archivos de programa is program files in Spanish. Why would your program not find the database if you use App.Path in your code???? That is what it is used for and it would not matter what language you used.
-
May 22nd, 2007, 12:11 AM
#39
Re: Vista and VB6 issue...
You might want to use this code instead. It automatically handles getting the user name also
Code:
[Code ]
var s: Integer;
function GetAppFolder(Param: String): String;
begin
s := InstallOnThisVersion('0','6');
if s = 0 then
Result := 'C:\Users\Public\' + ExpandConstant('{username}')
else
Result := ExpandConstant('{pf}');
end;
Last edited by randem; May 22nd, 2007 at 12:15 AM.
-
May 22nd, 2007, 06:20 AM
#40
Fanatic Member
Re: Vista and VB6 issue...
randem,
Archivos de programa is program files in Spanish. Why would your program not find the database if you use App.Path in your code???? That is what it is used for and it would not matter what language you used.
Its because I do not use App.path in my code as I use a ADO Data Bound Control which I build the path for using the wizard, as I said at the outset I am not very good at this programming but I get by at the moment using all the help I can get.
Many thanks for your advice
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|