cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mayoosuf
Level 3

How to re create application name folder

Very recently our Quality Assurance folks found an issue in our application setup, While they was installing it to the some other drive.
E.g. They have installed in to,

D:\ and application installed as following;
D:\application.exe
D:\Application.dll
D:\Application1.dll
D:\Application2.dll
D:\Application3.dll

Ultimately the application is installed and while the user trying to uninstall, they loss all the data what they has previously was in the selected drive.
E.g. They have installed in to D:\ and application installed as following;

D:\application.exe
D:\Application.dll
D:\Application1.dll
D:\Application2.dll
D:\Application3.dll
D:\My Data
D:\My Documents

Is there any solution to come over from this problem (the NSIS and INNO Setup compiler has a feature when the user is selecting a location what is not default, it creates a folder with the name of the application )?
Labels (1)
0 Kudos

(4) Replies
Kelter
Level 10

What is your project type? (Basic MSI, InstallScript MSI, InstallScript)?
0 Kudos
mayoosuf
Level 3

its an InstallScript MSI project, pls help me!
0 Kudos
Kelter
Level 10

Let me make sure i'm understanding the problem correctly. If a user selects the drive root as an installation directory, then on uninstall, setup deletes the installation directory (D:\) and everything in it. You can author logic to prevent D:\ from becoming the target directory. In your InstallScript view, override the OnFirstUIBefore event. Where you see this code:
Dlg_SdAskDestPath:    	
nResult = SdAskDestPath(szTitle, szMsg, INSTALLDIR, 0);
if (nResult = BACK) goto Dlg_SetupType;

You can then test the INSTALLDIR variable to see if the length is greater than 3, and if not, add the following code:
    if( StrLength(INSTALLDIR) <= 3 )then
INSTALLDIR = INSTALLDIR ^ "MyProductName";
endif;


If I identified the problem, then this solution should work.
0 Kudos
mayoosuf
Level 3

That works, even those its a static method, Thanks allot
0 Kudos